2010-09-14 79 views

回答

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; 
} 
+3

在viewWillAppear中,而不是viewDidLoad中設置此,可以確保你永遠看不到默認的斜角角落。否則,這就像一個魅力。謝謝。 – toddheasley 2011-07-14 02:16:11

+2

從2016年來到這裏:這段代碼並不適合我,但self.view.superview.layer.cornerRadius = 0;沒有。如果上面的代碼不適合你,那麼給一個鏡頭。 – BreadicalMD 2016-08-11 16:36:56