回答

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