4

UIView我必须从中删除圆角UIViewcontroller。这是图片在此处输入图像描述

我正在展示详细视图

detailView.modalPresentationStyle = UIModalPresentationFormSheet;

我想呈现UIViewcontroller没有圆角的视图。有人对这个问题有想法吗?

4

1 回答 1

7
//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;
 }

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

于 2013-02-20T10:19:08.967 回答