I'm trying to present a viewcontroller with a transparent background on both iOS 7 and iOS 8.
Just by changing the viewcontroller's modalPresentationStyle property to FormSheet I can get it working on iOS 7.1.
What I want is a universal way to that on ios7+
I have tried using other options to modalPresentationStyle, like: OverCurrentContext, CurrentContext and PageSheet.
I also tried to use the modalPresentationStyle.Custom but didnt have any success.
I have NavigationController if that helps in anything.
The code for the presenting view controller:
InfoViewController *info = [[InfoViewController alloc] initWithNibName:@"InfoViewController" bundle:nil];
[self presentViewController:info animated:YES completion:nil];
And the code for the viewDidLoad(which I think has a relevant part on this) of the presented ViewController:
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
self.modalPresentationStyle = UIModalPresentationStyle.PageSheet
}
I′m using swift and Xcode 6.
Here′s a screenshot of what I have now and of what I want, respectively:
Here's an example code: https://github.com/pbassut/TransBackgroundViewController
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…