How do you load a view on top of another view in the iPad

三世轮回 提交于 2019-12-13 03:24:19

问题


How do you load a view on top of another view in the iPad like in the wordpress app when it asks you to setup your blog. Can you show or post me some sample code. I have an NSUSerdefaults setup so it will display this on the first launch. I would like this view to look like this http://uplr.me/files/p45064.png

See how it has the shaddows and the view is darkened in the back. Thats what I am trying to do.


回答1:


I got it

AddViewController* firstLaunchController = [[AddViewController alloc] initWithNibName:nil bundle:nil];
UINavigationController *modalNavigationController = [[UINavigationController alloc] initWithRootViewController:firstLaunchController];
modalNavigationController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
modalNavigationController.modalPresentationStyle = UIModalPresentationFormSheet;
[detailViewController presentModalViewController:modalNavigationController animated:YES];
[firstLaunchController release];

was so simple

Thanks everyone




回答2:


The second view is loaded as a modal view of the first. See -[UIViewController presentModalViewController:animated:].

On the iPad, when you present a modal view, you get the darkening automatically.



来源:https://stackoverflow.com/questions/2600289/how-do-you-load-a-view-on-top-of-another-view-in-the-ipad

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!