开发者

How to present a Modal View over a Tab Bar Application?

开发者 https://www.devze.com 2023-01-10 08:55 出处:网络
I\'m relatively new to iPhone programming but have read my way through a hefty book already. I want to build a Tabbed Application where in one of the tabs I can push a button that presents a modal vi

I'm relatively new to iPhone programming but have read my way through a hefty book already.

I want to build a Tabbed Application where in one of the tabs I can push a button that presents a modal view over the screen.

I have built demo apps that utilize UITabBarController and the ModalView system, but I can't figure out how to combine them.

Help is greatly appreciated. I'm r开发者_如何学JAVAeally stuck because it's this set up of the views that's the only thing I don't know how to do with my app. If you could give me a rundown (sample code) of how the setup should look, that would be fantastic.

thank you!


You can show a display a modal view controller from one of the tabs of your tab bar controller using the following code.

UIViewController* vc = [[[UIViewController alloc] init] autorelease];
[self presentModalViewController:vc animated:YES]

That will cause the View Controller to be displayed modally over the tab bar.

0

精彩评论

暂无评论...
验证码 换一张
取 消