具有方形(0半径)角的UIModalPresentationFormSheet?

时间:2010-09-14 00:54:02

标签: ios4 uimodalpresentationformsh

默认情况下,iPad模态表单会获得圆角。在Apple的几个应用程序中,例如iTunes,表单有完美的方角。是否有一种相对简单的方法来删除不会让我从App Store中拒绝的角落半径?

1 个答案:

答案 0 :(得分:3)

将它放在您要显示的视图中:

//You will have to link to the QuartzCore library
#import <QuartzCore/QuartzCore.h>

- (void)viewDidLoad
{
    [super viewDidLoad]; 
    //set border radius on initial load
    self.view.layer.cornerRadius = 0;
}

- (void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
     //for some reason the cornerRadius resets itself on orientation change
    self.view.layer.cornerRadius = 0;
 }