回答

3
//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中查看。

+0

谢谢你回答Bhargavi我尝试过,但没有写在didRotateFromInterfaceOrientation方法中。接力赞赏的答案。 – 2013-02-20 10:45:57

+0

伟大的答案 - 但是你应该包括对超类的调用([super viewWillAppear:animated];)或者像UITableViewControllers中的自动行取消选择的东西将停止工作。 – 2013-05-10 14:06:18

+0

@GrahamPerks是的,我同意你的建议。但我只是想表明在哪里写'cornerRadius'。 – 2013-05-11 04:33:49