删除uiviewcontroller的视图ipad的圆角

时间:2013-02-20 10:07:52

标签: ios ipad uiview uiviewcontroller presentmodalviewcontroller

我必须从UIView的{​​{1}}移除圆角。这是enter image description here

的图像

我用

呈现详细视图
UIViewcontroller

我想在没有圆角的情况下呈现detailView.modalPresentationStyle = UIModalPresentationFormSheet; 。 有人知道这个问题吗?

1 个答案:

答案 0 :(得分:5)

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

- (void)viewWillAppear:(BOOL)animated
{
    //set border radius on visibility
    self.view.layer.cornerRadius = 0;
}

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

可以在您正在呈现的ViewController中查看self.view。