UIView shift to partially overlap another UIView

It has been several hours since I was looking for how to make the animation as above. So far I have found this folding honcheng navigation , and it's pretty cool. However, I want a little easier than that. The way the google map is displayed on the right side, what I want is minus the effect of paging. Somehow I like Pulse news for the iPad, which is also amazing.

So yes, if anyone has done this, you can offer some ideas on how I can find out. Or perhaps an open source code that I could look at and do reverse engineering.

+5
source share
1 answer

, , , Pulse.

.h UIView secondView.

- (void)viewDidLoad
{
    [super viewDidLoad];
    secondView = [[UIView alloc] initWithFrame:CGRectMake(320, 0, 320, 480)];
    [secondView setBackgroundColor:[UIColor redColor]];
    [self.view addSubview:secondView];
}

- (IBAction)myAction:(id)sender
{
    [UIView animateWithDuration:0.45 animations:^{
        if (secondView.transform.tx == 0) {
            [secondView setTransform:CGAffineTransformMakeTranslation(-200, 0)];
        }else{
            [secondView setTransform:CGAffineTransformMakeTranslation(0, 0)];
        }

    }];
}

, !

+6

All Articles