2014-12-13 82 views

回答

0

嘗試改變這樣的阿爾法值: -

[[UIColor clearColor] colorWithAlphaComponent:0.6]; 
+0

我試了一下,得到了相同的事情。 – DimonDeveloper 2014-12-13 15:37:02

+0

是的,並且有清晰的顏色。視圖可以是透明的,但超視圖不是。 – DimonDeveloper 2014-12-13 15:43:15

+0

self.view.superview = nil;錯誤 - 分配到只讀屬性 – DimonDeveloper 2014-12-13 15:52:35

0

如果你設置主UIViewController視圖的背景色,你需要se前TUP是:

- (void)setupModalPresentationStyle 
{ 
    self.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; 
    if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) { 
     self.modalPresentationStyle = UIModalPresentationOverFullScreen; 
    } 
} 

- (void)awakeFromNib 
{ 
    [super awakeFromNib]; 
    [self setupModalPresentationStyle]; 
} 

當你提出這個UIViewController中,你需要設置當前呈現的UIViewController:

- (void)doneButtonTap:(id)sender { 
    self.modalPresentationStyle = UIModalPresentationCurrentContext; 
    [self presentViewController:detailsViewController animated:YES completion:nil]; 
} 
+0

在哪裏編寫此代碼? self.modalPresentationStyle = UIModalPresentationCurrentContext; [self presentViewController:detailsViewController animated:YES completion:nil]; – DimonDeveloper 2014-12-13 18:19:56

+0

某處,您展示您的模態視圖控制器 – 2014-12-13 18:46:01