简体   繁体   中英

How to present uiview from tabbar

I am working on a TabBarController base application and my TabBarController has 5 tabs.

When a user clicks on the third tab I want to present a UIView with dimensions of 280*100 and the background shows the selected ViewController .

Just have the 3rd tab reference a 3rd UIViewController that has a UIView with the dimensions you specified. If you are concerned about the nav info, etc. showing in the UIViewContoller, then you can suppress all of that.

在此处输入图片说明

If you want to use the tab bar to change the UI appearance of the same UIViewController (eg tab1 shows a UIView, tab2 shows a button, etc. all within the same VC) then you are using the wrong control.

See this UITabBarController Class Reference for the role of UITabBarController

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM