uitabbarcontroller

How to insert UINavigationController inside UITabBarController

亡梦爱人 提交于 2019-12-05 02:34:30
问题 How to insert UINavigationController inside UITabBarController . Currently I have main UITabBarController with declatarion inside application delegate like this (so tab is main) self.window.rootViewController = self.tabBarController; And inside one of tabs I want to insert UINavigationController , and can't get it. The code is contructed like this: MainWindow.xib with UITabBarController object with tab typed as UINavigationController (point to NavigationHistory.xib ) - screenshot: invalid

Access a view controller from appdelegate using storyboard

巧了我就是萌 提交于 2019-12-05 02:24:17
问题 I have followed this Ray Wendelich Tutorial RayWenderlichTutorial Tabbarcontroller using storyboards Just see the storyboard image. Ray is accesing 'playersViewcontroller using the below code' UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController; UINavigationController *navigationController = [tabBarController viewControllers][0]; PlayersViewController *playersViewController = [navigationController viewControllers][0]; When I'm trying to access

iPhone : Custom tabbar without the awful More menu

…衆ロ難τιáo~ 提交于 2019-12-05 02:24:06
问题 So i wanted to build a tabbar that has more than 5 items and is scrollable and found this article. Easy done by subclassing the UITabBarController and hide the existing tabbar: for(UIView *view in self.view.subviews) { if([view isKindOfClass:[UITabBar class]]) { view.hidden = YES; break; } } Then i just add a UIScrollView and throw some buttons in there based on the items-collection of the tabbarcontroller. int i = 0; for (UITabBarItem *item in self.tabBar.items) { UIView *tab = [[[UIView

Round Top Corners of a UIView in Swift

一个人想着一个人 提交于 2019-12-05 01:14:44
问题 I am trying to round top corners using below code func roundCorners(corners:UIRectCorner, radius: CGFloat) { let path = UIBezierPath(roundedRect: self.bounds, byRoundingCorners: corners, cornerRadii: CGSize(width: radius, height: radius)) let maskLayer = CAShapeLayer() maskLayer.frame = self.bounds maskLayer.path = path.cgPath self.layer.mask = maskLayer } use myView.roundCorners(corners:[.topLeft, .topRight], radius: radius) But it's rounding one side of the view: this is in a tableView

UINavigationController doesn't work in a the moreNavigationController of a UITabBarController

戏子无情 提交于 2019-12-05 01:03:04
问题 I'm dealing with UINavigationControllers in my application, all handled by an UITabBarController . Everything works fine until my controllers fall into the automatically generated "More" tab. I reproduced the problem in the simplistic example. Am I doing something wrong? I can't figure out. Thanks for your help. #import <UIKit/UIKit.h> @interface testAppDelegate : NSObject <UIApplicationDelegate, UITabBarControllerDelegate> { UIWindow *window; UITabBarController *tabBarController; } @property

UITabBarItems in UITabBar show after I click the item not when application launches

守給你的承諾、 提交于 2019-12-05 00:59:46
This application I'm writing has a problem. I'm setting up the UITabBar in my application window and set the icons in the view files. But when i run the app, the first icons show up (because the view is loaded I guess) and the other icons do not show up until I click them. Do i need to implement self.tabBarItem in some other method not viewDidLoad ? Thanks in advance to everyone! - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { tabBar = [[UITabBarController alloc] init]; SubscriptionsController *subscriptionsController = [

Programmatically setting tabBarItem title in Swift

邮差的信 提交于 2019-12-04 23:51:23
I have four UIViewControllers that are linked to a UITabBarController's tab bar. I need to set the tab bar item titles outside of the storyboard, and inside of their classes. I've tried.. class MyViewController: UIViewController { required init(coder aDecoder: NSCoder) { super.init(coder: aDecoder) self.title = NSLocalizedString(MyConstants.StringKeys.TabName, tableName: Constants.Strings.MyTable, comment: Constants.EmptyString); } } This is called, but the title is never set. Same with self.tabBarItem.title = "the title" I've also tried setting the title in viewDidLoad, but that only updates

How to Create a Custom tabBarController to simulate uiTabBarController

时光怂恿深爱的人放手 提交于 2019-12-04 21:42:19
How to create an custom tabbar controller which has custom background image, custom icons, and custom labels and positioning but serves exactly the same purpose as UITabBarController. I badly seeking for an optimal solution for this. When i learn the solution this will really help me to write a generic wrapper and save more time. I have tried having UIViews and making it as footer and banner seperately, but it all consumes lots of memory. I want a simplistic approach which will make the development very optimal. Please help me friends. Create a view (in IB or in code) that will contain 2

Tab bar controller inside a navigation controller, how to push new viewcontrollers to the tabcontroller?

浪尽此生 提交于 2019-12-04 21:31:43
Design requirement: Show a list of items the user can pick from After having picked an item, bring the user to a new view with a back button. The new view should contain a list of tabs at the bottom that are not present in the first screen When clicking an item in the tabs, a new screen should appear with a back button and the tabs should still be visible at the bottom. Clicking a tab should take the user back up the hierarchy to #2. Not to the first screen. I have tried following structure: UINavigationController UIViewController with a UITableView UIViewController with a UITabBar (like here

XCode: Remove Selection Indicator Image from a particular tab

六眼飞鱼酱① 提交于 2019-12-04 21:14:50
I am using a custom tab bar image and the middle tab is also a custom image (much like an older version of Instagram). Here is some of my code: UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController; UITabBar *tabBar = tabBarController.tabBar; [tabBar setBackgroundImage:[UIImage imageNamed:@"CustomTabBar.png"]]; UITabBarItem *tabBarItem3 = [tabBar.items objectAtIndex:2]; tabBarItem3.title = nil; tabBarItem3.image = nil; [tabBarItem3 setFinishedSelectedImage:[UIImage imageNamed:@"tab-button-selected.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"tab