uitabbarcontroller

iPad App Portrait Only?

守給你的承諾、 提交于 2020-01-15 11:44:06
问题 My app is entirely designed for IOS6. I use an xib for the iPhone and another one for the iPad. My AppDelegate sets up a TabBarController, though there is no class for the TabBarController itself. The TabBarController has two tab items, 1 a NavigationController, and 1 a View Controller, each of which has its own class. I would like the iPad to be able to run in just Portrait mode, upside down, and normal. On the summary tab of Target in Xcode, I have supported interface orientations set to

Reload / Refresh tab bar items in a ViewController ?

痞子三分冷 提交于 2020-01-14 10:30:08
问题 I am trying to change images of my tabbar in a ViewController, but to display the new images, I must click on each tab bar item. for (CustomTabBarItem *myItem in self.tabBarController.tabBar.items){ myItem.enabled = YES; myItem.badgeValue = @"1"; UIImage *myImage = [[UIImage alloc] initWithContentsOfFile:[[DesignManager sharedManager] getPathOfFile:@"test.png"]]; *myItem.imageSelect= *myImage; // change images of each item. don't appear if I dont click on the item } Anyone know How can I can

TabBarController didSelectViewController not working

…衆ロ難τιáo~ 提交于 2020-01-14 09:31:45
问题 I know this is a very repeat topic, but I can't get it works. MainTab.h: #import <UIKit/UIKit.h> @interface MainTab : UITabBarController<UITabBarControllerDelegate, UITabBarDelegate> { IBOutlet UITabBarController *tabController; } @property (nonatomic,retain) IBOutlet UITabBarController *tabController; @end MainTab.m - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom

How to change background color for tab in tvOS 13?

≡放荡痞女 提交于 2020-01-14 03:37:21
问题 TvOS 13. I have a UITabBarController with tabs. And can customize almost everything except this obvious thing: focused tab's background. It's always white. Guide tells Specify tints for selected and unselected items I tried: view.backgroundColor = .purple tabBar.tintColor = .yellow tabBar.barTintColor = .red tabBar.unselectedItemTintColor = .brown tabBar.backgroundColor = .green tabBar.backgroundImage = UIColor.blue.toImage() tabBar.shadowImage = UIColor.orange.toImage() tabBar

Passing a managedObjectContext through to a UITabBarController's views

左心房为你撑大大i 提交于 2020-01-13 12:16:12
问题 I have an app which is based on the Utility template (where you flip over the view to see another). On the first view there is a login screen, then it flips over to reveal a UITabBar style interface. I'm having trouble working out how to pass the managedObjectContext from the App Delegate (where it is created) all the way through to each of the Tab Bar's views. App Delegate's managedObjectContext get passed to FrontLoginViewController which gets passed to BackViewTabBarViewController .. where

Determine viewWillAppear from Popped UINavigationController or UITabBarController

佐手、 提交于 2020-01-13 11:54:23
问题 I am unable to find a way to distinguish between popping from the Nav controller stack and entering the view controller from the UITabBarController. I want to call a method in ViewWillAppear only when the view is presented from the TabBar, not when someone presses back in the navigation controller. If I wasn't using a TabBarController, I could easily get this functionally using viewDidLoad. I've tried, override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) println("View

Determine viewWillAppear from Popped UINavigationController or UITabBarController

荒凉一梦 提交于 2020-01-13 11:51:10
问题 I am unable to find a way to distinguish between popping from the Nav controller stack and entering the view controller from the UITabBarController. I want to call a method in ViewWillAppear only when the view is presented from the TabBar, not when someone presses back in the navigation controller. If I wasn't using a TabBarController, I could easily get this functionally using viewDidLoad. I've tried, override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) println("View

How to clip larger images to fit into tabBar icons in tabBarController built programmatically.

妖精的绣舞 提交于 2020-01-13 08:58:30
问题 I have created a tab controller programmatically. Now, I wanted to add images to the different tabs, for which I used : self.tabBarItem.image = [UIImage imageNamed:@"Sample_Image.png"]; The problem is Sample_image is larger in size than is required by tab. So just want to know how can I clip the image to fit into tabs. 回答1: Sample_image is larger in size than is required by tab. Try this piece of code as this will resize the required image and return an UIImage instance with 30x30 size (size

UITabBarController with UIScrollView. Scroll offset change when tab switch

雨燕双飞 提交于 2020-01-13 06:27:11
问题 I have successfully created a TabBar with two ScrollView-tabs. However, if i scroll to the bottom in one tab and then switch tab and then switch back, my content seem to have disappeared upwards. If i try to scroll to the top i get stuck in the middle of the content but the scrollview thinks im at the top. What i know so far: contentView.frame.origin.y - (contentView is my view that resides in the ScrollView). If i print this variable when scrolling the first time i get 0 in every printout. I

UITabBarController with UIScrollView. Scroll offset change when tab switch

家住魔仙堡 提交于 2020-01-13 06:26:46
问题 I have successfully created a TabBar with two ScrollView-tabs. However, if i scroll to the bottom in one tab and then switch tab and then switch back, my content seem to have disappeared upwards. If i try to scroll to the top i get stuck in the middle of the content but the scrollview thinks im at the top. What i know so far: contentView.frame.origin.y - (contentView is my view that resides in the ScrollView). If i print this variable when scrolling the first time i get 0 in every printout. I