Tag: uitabbarcontroller

如何自定义“更多”button的UITabBarController?

我添加了UITabBarController作为RootView,我也知道当你有更多的tabBarItem时会自动添加'more'button。 所以它的所有工作熟练但我有两个问题: 1)我如何设置图像“更多”TabBarItem? 2)myTabBarItem未正确添加(请参阅图像以获得更多理解)其唯一的devise相关问题 图片说,我的设置 self.tabBarController.tabBar.tintColor = [UIColor redColor]; 而我的UITabBarItem是橙色的颜色,所以在这里你可以看到我的tabBarItem不适合UITabBar,也不知道如何在“更多”button上添加图像。 请帮我关于这个问题。 提前致谢。

使用Tab Bar Controller时,是否可以打开某个button?

这个问题有点混淆,所以希望图像会更有帮助。 这是设置: 所以,我想要第一个视图button打开FirstViewController ,我想第二个视图button来打开SecondViewController 。 如果我将第二视图button链接到SecondViewController像这样: 我失去了标签导航。 如果我把这个button连接到TabViewController像这样: 那么它会自动打开到FirstViewController 。 除非我错过了一些东西,这似乎需要做一点额外的代码,但我似乎无法find任何解释如何做到这一点。 谢谢!

编辑button不显示在UITabBarController的MoreNavigationController中

一个UITabBarController被推入堆栈: let presenter = presentingViewController as! UINavigationController let tabvc = UITabBarController() tabvc.viewControllers = vcs tabvc.customizableViewControllers = vcs presenter.pushViewController(tabvc, animated: true) 一旦呈现更多标签button正确显示,但编辑button重新排列标签栏不。 根据MoreNavigationController上的文档 : 标准更多项目的界面包括一个编辑button,允许用户重新configuration标签栏。 默认情况下,用户可以重新排列标签栏上的所有项目。 如果您不希望用户修改某些项目,则可以从customizableViewControllers属性中的数组中删除相应的视图控制器。 我的猜测是标签栏不是很高兴在导航控制器。 任何关于带回编辑button的想法?

setSelectedImageTintColor在iOS 7中不起作用

我想在iOS 7中设置setSelectedImageTintColor ,但它不工作。 这是我在我的AppDelegate.m下的didFinishLaunchingWithOptions的代码 UITabBarController *tabBarController = (UITabBarController *) self.window.rootViewController; UITabBar *tabBar = tabBarController.tabBar; for (UITabBarItem *item in tabBar.items) { UIImage *image = item.image; UIImage *correctImage = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; item.image = correctImage; } [[UITabBar appearance] setTintColor:[UIColor whiteColor]]; [[UITabBar appearance] setSelectedImageTintColor:[UIColor colorWithRed:44.0/255.0 green:176.0/255.0 blue:28.0/255.0 alpha:1.0]]; [[UITabBar appearance] setBarTintColor:[UIColor colorWithRed:51.0/255.0 green:51.0/255.0 blue:51.0/255.0 alpha:1.0]]; 它仍然不会显示selectedImageTintColor。 选中时是白色的; 灰色时,未选中。 我究竟做错了什么?

如何使基于我的JSON响应数组的tabbar(ios swift)

问题:我想创build基于我的JSON响应数组的标签栏,这意味着,如果我有6个元素作为响应,它将创build6个选项卡。 试过了:我已经通过使用水平滚动collections视图,但我想通过原来的标签栏。 那么,我该怎么做呢? please tell me the possible solutions and dont put this on hold.. 这是我的回应,我该怎么办? tabs = ( { id = 0; name = Home; }, { id = 1; name = Winkel; }, { id = 2; name = Zoeken; } ); }) 感谢@Ankit为swift代码,但是当您使用您的代码和传递名为“arr”的数组得到此错误无法将types'NSMutableArray'的值转换为期望的参数types'[[String:Any]]' 这是我的代码 func web() { request(.GET, "http://www.horecasupply.nl/AJAX?function=appStructure", parameters: nil, encoding: […]

在iPhone中的标签栏控制器

我在我的应用程序中添加了两个选项卡,使用这些选项卡加载两个视图控制器 Tab1:首页 表2:collections 所以我写下面的代码来实现这一点 在应用程序代表 AppDelegate.h @class ViewController,FavViewController; @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @property (strong, nonatomic) ViewController *viewController; @property (strong, nonatomic) FavViewController *favViewController; @property (strong, nonatomic) UITabBarController *tabBarController; @end AppDelegate.m @implementation AppDelegate @synthesize window = _window; @synthesize viewController; @synthesize favViewController; @synthesize tabBarController; – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = […]

通过视图控制器,标签栏控制器,导航控制器和视图控制器传递数据

这可能是一个非常简单的实现,但我是iOS新手,我似乎被卡住了。 所以,基本上,我有一个选项卡式的应用程序。 我决定除了标签栏以外我还想要一个导航栏。 为了做到这一点,我把标签栏控制器,然后我添加我的视图控制器,并embedded到每个视图控制器的导航控制器,然后连接到标签栏。 我在故事板中的层次结构看起来有点像这样: 视图控制器 标签栏控制器 导航控制器 视图控制器 导航控制器 视图控制器 我在这里卡住的部分是当试图从第一个视图控制器和任何其他视图控制器传递数据。 在添加导航控制器之前,我正在使用prepareForSegue方法传递数据,如下所示: – (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([[segue identifier] isEqualToString:@"logged"]) { UITabBarController *tabar=segue.destinationViewController; SecondViewController *svc=[tabar.viewControllers objectAtIndex:1]; svc.groupArray = [(NSArray*)sender objectAtIndex:0]; svc.userArray = [(NSArray*)sender objectAtIndex:1]; svc.taskArray = [(NSMutableArray*)sender objectAtIndex:2]; svc.selfArray = [(NSMutableArray*)sender objectAtIndex:3]; [tabar setSelectedIndex:1]; } } 正如你所看到的,我将数据传递给了我的第二个视图控制器,并使用performSegueWithIdentifier方法将标签栏索引设置为1,因为我希望打开第二个页面。 所有这一切都工作得很好,直到我介绍了导航控制器到我的代码,因为我想要导航栏。 这是一切都非常糟糕的时候。 如果我尝试按原样运行代码,则应用程序会在控制台中使用以下输出进行崩溃: [UINavigationController setGroupArray:]:无法识别的select器发送到实例0x7ffa6acec620 ***由于未捕获exception'NSInvalidArgumentException',原因:' […]

self.navigationController.tabBarController.selectedIndex不起作用

我有一个UITabBarController包含4个不同的UIViewControllers 。 在第一个选项卡上有一个包含其子UIViewController的UINavigationViewController 。 而不点击标签栏,我想要在第二个选项卡上的用户。 为此我尝试了: self.navigationController.tabBarController.selectedIndex = 1; 但它不工作。 忽略任何错误,我是一个新手。 谢谢。

iOS – UIVIewController中的UITableView不显示所有行

我正面临UIViewController UITableView一个错误。 我会试着解释一下情况和我的问题。 我有一个TabBarController其中一个视图是一个UITableView的UIViewController 。 我不使用UITableViewController因为我有我的UIViewController一些具体的控制。 所以,当我的UIViewController不是我的TabBarController的孩子,一切都没问题:所有的行都显示正确。 但是,当我设置我的UIViewController作为我的TabBarController一个孩子,我有这个错误:只有一些行显示(精确到三分之一,在所有情况下)。 我只是不明白发生了什么。 我的代码似乎工作,但只有当我的UIViewController不是我的TabBarController的孩子。 在这种情况下是否还有另外一种方法? 有我的UIViewController的代码: class ProfileController: UIViewController, UITableViewDataSource, UITableViewDelegate { @IBOutlet weak var tableChallenges: UITableView! @IBOutlet weak var profileTabs: UISegmentedControl! var pageViewController : UIPageViewController! override func viewDidLoad() { super.viewDidLoad() self.tableChallenges.dataSource = self self.tableChallenges.delegate = self self.tableChallenges.reloadData() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources […]

将UITabBarController添加到UIViewController

我的应用程序目前有一个UINavigationController ,我想推一个UITabBarController在点击一个button时的某一点。 我试图在Interface Builder上创build它(而不是编程)。 所有的在线教程显示了如何创build一个基于标签栏的应用程序,其中涉及拖动一个UITabBarController到MainWindow.xib显然不是我想要的。 我所做的是创build一个UIViewController和它的nib文件,拖动一个UITabBarController 。 现在将UIViewController推送到导航控制器将显示一个空视图(空视图)。 删除视图控制器中的视图将会使应用程序崩溃。 我如何告诉UIViewController加载一个UITabBarController而不是它自己的视图? 对于那些投降我的人来说,至less提供一个评论是不错的。 这个问题不是一个很差的问题。 问题是要求如何以非正统的方式使用UITabBarController的build议。 我尝试了大部分的build议,他们不工作。 如果你是低调投票,至less写评论。