UIModalTransitionStylePartialCurl half page

后端 未结 4 1349
陌清茗
陌清茗 2021-01-13 12:15

I\'m displaying an UIViewController by the following way:


MyViewController *myVc = [[MyViewController alloc] initWithNibName:@\"MyViewController\" bundle:ni         


        
相关标签:
4条回答
  • 2021-01-13 12:35

    iOS only uses the first-level children of the UIView to decide where to position the partial page curl. That allows you to add a 2nd level child view with a frame of e.g. (0, -50, 320, 100) that slips into the area you call the "dead area".

    0 讨论(0)
  • 2021-01-13 12:41

    I believe the posters here and in related threads are having problems because they are trying to decorate the background of the underlying view using another view, such as an image view. The correct way to set a background - and which will not affect the page curl, is to actually set the background.

    - (void)viewDidLoad {
        [super viewDidLoad];
    
        //BG
        self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"StitchTileBG.png"]];
    }
    

    Leave using views and such for actual user interface elements

    0 讨论(0)
  • 2021-01-13 12:41
    MyViewController * myVc = [[MyViewController alloc] initWithNibName:nil bundle:nil];
    [UIView beginAnimations:@"flipPage" context:NULL];
    [UIView setAnimationDuration:2];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
    [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:YES];
    [self.view addSubview:myVc.view];
    [UIView commitAnimations];
    
    0 讨论(0)
  • 2021-01-13 12:45

    What's the problem here? Populate content in the modalView in such a way that the visible area is utilized. If I am not wrong, the modalPageCurl effect has no option to set the extent of curl (or how much of the screen it should occupy).

    So I suggest you skip this approach & focus on trying to cover (or utilize) as much screen is available...

    0 讨论(0)
提交回复
热议问题