uitabbarcontroller

How do I hide/show tabBar when tapped using Swift in iOS8

好久不见. 提交于 2019-12-28 04:50:06
问题 I am trying to mimic the UINavigationController's new hidesBarsOnTap with a tab bar. I have seen many answers to this that either point to setting the hidesBottomBarWhenPushed on a viewController which only hides it entirely and not when tapped. @IBAction func tapped(sender: AnyObject) { // what goes here to show/hide the tabBar ??? } thanks in advance EDIT: as per the suggestion below I tried self.tabBarController?.tabBar.hidden = true which does indeed hide the tabBar (toggles true/false on

How to hide/show tab bar of a view with a navigation bar in iOS?

那年仲夏 提交于 2019-12-28 01:51:14
问题 I have views with a navigation bar and a tab bar. What I would like to happen is to hide the tab bar on a certain view and show the tab bar again when the user changes views. I saw a snippet of code for hiding the tab bar: -(void)makeTabBarHidden:(BOOL)hide { // Custom code to hide TabBar if ( [tabBarController.view.subviews count] < 2 ) { return; } UIView *contentView; if ( [[tabBarController.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]] ) { contentView = [tabBarController

Prevent automatic popToRootViewController on double-tap of UITabBarController

99封情书 提交于 2019-12-27 17:39:07
问题 The default behavior of a UITabBarController is to pop the contained UINavigationController to the root view controller when a particular tab is tapped a second time. I have a particular use case where I'm wanting this to not work automatically, and I'm having a hard time figuring out how to prevent this. Has anyone run into this, and if so, what did you do? Do I need to subclass UINavigationController and override popToRootViewController or is there a simpler way? 回答1: Use the

launching a modal view controller to work around the orientation “lock” of tab bar and nav VCs?

一世执手 提交于 2019-12-25 18:28:27
问题 I have an iPhone app with a root view controller (VC) of UITabBarController (set to portrait orientation) with several tabs, one of which is a simple UIViewController. In that UIViewController is a single button - "Play Video", which, when clicked opens a modal view of the video (and automatically starts playing the video). The video view is a UIWebView in a UIViewController. I've been trying to get the Web View's VC to change orientation to landscape but have not had any luck. I've looked

Can I have more than 1 UITabBarController?

喜你入骨 提交于 2019-12-25 16:39:37
问题 Lets imagine the scenario: UITabBarController - UITabBar - Tab 1: View Controller A - Tab 2: View Controller B When I click on View Controller A I want to push another UITabBarController: UITabBarController -UITabBar - Tab 1: View Controller 1 - Tab 2: View Controller 2 - Tab 3: View Controller 3 Is this possible? To have a UITabBarController push another UITabBarController onto the view stack? 回答1: You can certainly do this but I would rethink your design. Selecting a UITabBar item and

tabbarcontroller as a subview

拈花ヽ惹草 提交于 2019-12-25 11:15:27
问题 I have a main view screen with navcontroller in my app with two UIbuttons. Now i want that when I press one button a subview will be pushed. this I know how to do. The problem is that I want this subview to be with tabbarcontroller. I know how to implement tabbar on the main views (within the app delegate), but I have really hard time to do this as a subview.. How should I implement this? Thanks. 回答1: Don't. It's been dealt with many times here before that there is no supported way to have a

Setting each tab on TabBarController a different colour when selected?

霸气de小男生 提交于 2019-12-25 09:10:01
问题 I have a tab bar and want to set tints that are indipendent based on selected tab, I know I can tint them so they all change to 1 new color, however I havent been able to get them to each take on their own colour when selected. Is there a way to do this? currently have this, where the tint is just white, i want to tint each one indipendently 回答1: Select your Tabbar item and in attribute inspector set both Selected Image and Image for bar item check below Image for reference. 来源: https:/

CS193P UITabBarController MVC Help on Assignment 4

风流意气都作罢 提交于 2019-12-25 08:47:23
问题 I'm going through the Stanford CS193P course on iTunesU and am a little puzzled on how to do the recently viewed photos portion on assignment 4. In the assignment we are to have a tab bar controller with two tabs. 1st tab is a navigation controller that will show a table of places, which will push a table of photo names, which will push a scroll view with a photo 2nd tab is a navigation controller that will show a table of recently viewed photos, which will push a scroll view with a photo. I

Tabbar is not showing up after popToRootViewController

强颜欢笑 提交于 2019-12-25 07:57:48
问题 In my application, I hide tabbar by setting hidesBottomBarWhenPushed property of UIViewController . I'm not sure this behavior is designed or not, when I called popToRootViewController to pop all view controller stack, tabbar did not show properly if I pushed same view controller after. Even I tried to show tabbar by setting isHidden property after I called popToRootViewController but it didn't work neither. Weird part is, after tabbar disappeared, I pushed same view controller and I could

Why image shown in UITabBar, on selected item, not properly?

泪湿孤枕 提交于 2019-12-25 07:30:12
问题 I have an UITabBar and set 2 images for a tab(active item, deactive item). On deactive item tab icon shown properly as: Image here but when those item is active, icon not shown properly: Image here Can anyone help me to fix it? I was that it will colour just borders of the icon, not entirely 回答1: Check this screenshot: At right side of the screen see 'Rendered as' text and select drop down and use Original image. Your problem would be solved. Hope this helps.. 回答2: You need to use