Tag: uitabbarcontroller

hidesBottomBarWhenPressed在iOS 7中被忽略

这个代码运行良好,直到iOS 7发布。 我分配一个UIViewController ,与hidesBottomBarWhenPushed为YES ,作为UINavigationController的rootViewController 。 但TabBar正在显示。 以下是相关的代码: Login *lv = [[Login alloc] init]; lv.HowToUseShows = showHowToUse; lv.hidesBottomBarWhenPushed = YES; UINavigationController *BokShelfNav = [[UINavigationController alloc] initWithRootViewController:lv]; //… UITabBarController *tbController = [[UITabBarController alloc] init]; tbController.viewControllers = @[BokShelfNav,…]; 任何人有类似的问题?

如何让UITabBarselect指标图像填充整个空间?

我有一个UITabBarController我用这个代码来设置select指标图像: let selectedBG = UIImage(named:"tabbarbgtest.png")?.resizableImageWithCapInsets(UIEdgeInsetsMake(0, 0, 0, 0)) UITabBar.appearance().selectionIndicatorImage = selectedBG 但图像不能填满整个空间 – 请参阅下图: 图像只是一个82x49px的解决scheme的红色正方形,但具有更广泛的形象,它仍然不能填补整个空间。 希望你们能帮忙 – 谢谢。

用导航栏和后退button创build一个模态视图

我想创build一个模式视图与导航项目(正确的看法在我的屏幕截图),我想它有一个“后退button”。 我的应用程序是TabBar应用程序,我不希望这个视图有一个标签栏,但我想加载一个类似于“push”types的segue上一个视图(在我的屏幕截图上的左视图)。 我只能创buildpush segue来提供正确的导航回到左侧的视图,如果它被加载为模式视图,NavigationBar&TabBar不见了。 任何解决方法? 提前致谢!

更改uitabbarcontroller中的选项卡名称

我有一个TabBarController设置为主控制器选项卡,其中名称是使用界面生成器定义的。 现在我想以编程方式更改它的名字。 怎么可能呢?

更改UITabBarItem中的字体

嗨,我有这个代码,它不工作,我做错了什么? – (void)viewDidLoad { [self.tabBarItem setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIFont fontWithName:@"AmericanTypewriter" size:20.0f], UITextAttributeFont, nil] forState:UIControlStateDisabled]; } 顺便说一句,这不是我viewDidLoad唯一的事情,但我只是想告诉你们,那我把它放在哪里。

如何以编程方式添加UITabBarController(无xib文件或故事板)

我想添加一个UITabBarController到我的应用程序。 但是我只能用代码来做。 没有xib文件或故事板。 任何人都可以告诉我如何通过代码完全做到这一点? 编辑: _tbc = [[UITabBarController alloc] init]; aboutUsView = [[AboutUsView alloc] init]; helpView = [[HelpView alloc] init]; optionsView = [[OptionsView alloc] init]; self.navCon = [[UINavigationController alloc] initWithRootViewController:optionsView]; [self setnavigationCon:self.navCon]; [optionsView setdataLayer:self]; if ([navCon.navigationBar respondsToSelector:@selector(setBackgroundImage:forBarMetrics:)] ) { UIImage *image = [UIImage imageNamed:@"Navigation Bar_reduced.png"]; [self.navCon.navigationBar setBackgroundImage:image forBarMetrics:UIBarMetricsDefault]; [optionsView addSelfView:window]; } _tbc.viewControllers = [NSArray arrayWithObjects:navCon, […]

TabBarController和SplitViewController

我希望我的splitviewController显示在TabBarController 。 不幸的是,我首先决定只是有一个SplitViewController并select苹果的模板。 现在我处于不方便的位置,不知道如何将其添加到标签栏。 我尝试了几个在StackOverflow中解释过的东西,但最好的结果是在它下面有一个标签栏的黑屏:-( 我只是努力寻找一个很好,简单的方法。 我Appdelegate代码: – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. // Add the split view controller's view to the window and display. self.window.rootViewController = self.splitViewController; [self.window makeKeyAndVisible]; NSArray *searchPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); documentFolderPath = [searchPaths objectAtIndex: 0]; self.rootViewController.directoryPath = documentFolderPath; NSURL *docUrl = […]

UItabBar更改视图控制器

我有一些改变标签栏控制器的困难。 基本上我有3个控制器的UITabBarController。 第一次当应用程序启动。 我改变一个这样的控制器: NSMutableArray *muteArray = [[NSMutableArray alloc] init]; FirstPage *online; if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { online =[[FirstPage alloc] initWithNibName:nil bundle:nil]; }else{ online =[[FirstPage alloc] initWithNibName:nil bundle:nil]; } //adding all controllers of tab bar to array [muteArray addObjectsFromArray:_navigationCotroller.viewControllers]; online.tabBarControllers = [muteArray copy]; //replacing object of login controller to after login controller [muteArray replaceObjectAtIndex:1 withObject:online]; […]

UITableView被UITabBar部分隐藏

我有一个包含UINavigationController的UITabBarController 。 在可见的UIViewController ,我正在编程创build一个UITableView ,如下所示: self.voucherTableView = [[UITableView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame] style:UITableViewStylePlain]; self.voucherTableView.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth; 但是,UITabBar与UITableView重叠。 当我输出[[UIScreen mainScreen] applicationFrame]的高度时,它返回460.00,而它应该是367.00。 在界面生成器中,我使用“模拟度量标准”自动将视图的高度设置为367.00。 有什么我失踪,无论我尝试什么,我不能看到我需要的367.00高度。 作为一个临时解决scheme,我已经手动设置了UITableView的框架,这不是很理想,所以最好解决这个问题: self.voucherTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 320, 367) style:UITableViewStylePlain];

Swift标签栏视图prepareforsegue

在VC1(集合视图)这是我的prepareforsegue代码: override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { let segue = segue.destinationViewController as TabBarViewController var selectedIndex = self.collectionView.indexPathForCell(sender as UICollectionViewCell) segue.selectedIndexPassing = selectedIndex?.row } 当我到达VC2(这是TabBarViewController),我println()selectedIndexPassing看看返回。 它会正确返回。 然后,在VC2中,我把这个prepareforsegue叫做实际的视图控制器,或者是标签栏中的第一个button: override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { var segue = segue.destinationViewController as PlayerFromRosterViewController segue.selectedIndexPassingForDisplay = 1 } 但是,当我println()在VC3(PlayerFromRosterViewController)selectedIndexPassingForDisplay我得到零。 为什么不是从标签栏导航控制器传递给VC3的variables,也就是第一个标签栏button视图。