Tag: uitabbarcontroller

UITabBarController应用程序和pushViewController失败

我创build了一个TabBarController应用程序与UINavigationControllers ,A,B和C内的三个ViewControllers 。我已经创build了一切以编程方式。 现在我想在这些TabBar项目之一中推送一些ViewController。 例如,如果我在ViewController B和我按下一个button我想做一个pushViewController到ViewController:D,如果我按下新的button在DI想要去一个新的ViewController大肠杆菌,只要我想我应该可以回来NavigationController后退button。 问题是当我试图从D回到B,我有一个新的D和B之间的空ViewController,我得到这个错误: 首先,我在B中按下NEXTbuttonD: 2013-10-30 01:00:07.076 Wplanet[11964:70b] nested push animation can result in corrupted navigation bar 2013-10-30 01:00:07.444 Wplanet[11964:70b] Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted. 2013-10-30 01:00:07.582 Wplanet[11964:70b] Unbalanced calls to begin/end appearance transitions for <DViewController: 0x8aa7260>. 这里的应用程序不会崩溃。 其次,我在D,我想回到B(通过backButton在导航栏中): 第一次按下后退button,在导航栏中出现一个空的viewController(在D和B之间)。 然后我按下新的BackButton和应用程序崩溃与此错误: […]

interactivePopGestureRecognizer导致UITabBarController禁用交互

我有一个UITabBarController与三个标签栏项目。 标签栏项目具有UINavigationControllertypes的视图控制器。 每个导航控制器都有UIViewController作为顶视图控制器。 导航控制器堆栈顶部的每个视图控制器都有自己的stream程。 当用户在屏幕边缘滑动触发interactivePopGestureRecognizer ,并从堆栈popup视图控制器时,标签栏项变得不可交互。 任何想法,为什么发生这种情况? 我只能在现有视图控制器顶部推另一个视图时进行交互。

UIMoreNavigationController和UITabBarController的问题

这个问题一直困扰着我,但是我想我终于明白了什么是错的。 我想我现在只需要一个解决scheme… 这是应用程序的背景。 用户可以使用大约6个不同的选项卡,使用UITabBarController进行显示。 这些选项卡中的每一个都是UINavigationController中的自定义UIViewController子类。 所有6个选项卡都设置在一个nib文件(MainWindows.xib)中。 我需要能够隐藏和显示不同的标签,取决于用户是否login,以及他们login谁。 我有这样的工作: 在应用程序启动(应用程序:didFinishLaunching:…),六个选项卡被存储到我有一个NSMutableArray。 这工作正常… 当用户login或注销时,我从NSMutableArray访问他可以使用的选项卡,并将它们添加到UITabBarController中,如下所示: [tabBar setViewControllers: [NSArray arrayWithObjects: [viewControllers objectAtIndex:1], [viewControllers objectAtIndex:5], nil] animated:YES]; viewControllers是我之前用6个选项卡做的NSMutableArray。 在我创buildNSLog之后做这个,这就是我所期望的: 2012-02-24 11:45:57.690 [redacted][26155:207] ( "<UINavigationController: 0x8249db0>", "<UINavigationController: 0x841a3f0>", "<UINavigationController: 0x824be40>", "<UINavigationController: 0x824dbd0>", "<UINavigationController: 0x824e810>", "<UINavigationController: 0x841dfb0>" ) 但是,当我从最后一个自定义视图控制器,这是在列表中的最后一个导航控制器中打印self.parentViewController的值,我得到这个: 2012-02-24 11:54:51.247 [REDACTED][26306:207] <UIMoreNavigationController: 0x826ab00> 2012-02-24 11:54:51.248 [REDACTED][26306:207] <UITabBarController: 0x8257c50> 第一行是self.parentViewController,第二行是self.parentViewController.parentViewController 这似乎表明,heirachy是: UITabBarController – […]

标签栏和Mapview问题

我真的很困惑这个问题。 我最近在我的应用程序中遇到了我的mapview选项卡的问题。 甚至到了重新开始的地步。 我只是想知道如果我是唯一有这个问题,或者我在这里做错了什么。 我对iOS相当陌生,但我知道如何定义一个mapview的中心和跨度,以便集中在用户的位置。 我已经build立了自己的看法,似乎工作,但是当我把它放在一个选项卡控制器…我有一个问题。 地图在显示用户位置时保持缩小。 它应该显示用户的位置放大。 我的MapViewController: – (void)viewDidLoad { [super viewDidLoad]; [self.mapView.delegate self]; [self.mapView setShowsUserLocation:YES]; // Do any additional setup after loading the view from its nib. } -(void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation { CLLocationCoordinate2D loc = [userLocation coordinate]; MKCoordinateRegion region = MKCoordinateRegionMakeWithDistance(loc, 500, 500); [self.mapView setRegion:region animated:YES]; } 我也认为这可能与我在代表中创build选项卡控制器的方式有关。 我的应用程序委托: – (BOOL)application:(UIApplication […]

tabBarController不显示

我想以编程方式制作tabbarcontroller 。 tabBarController不显示在页面中。 任何人都可以告诉我们错了。我们可以在一个应用程序中创build多个tabbarcontroller ViewController.m – (void)viewDidLoad { report=[[UIViewController alloc]initWithNibName:@"ViewController" bundle:nil]; View1 *template=[[View1 alloc]initWithNibName:@"View1" bundle:nil]; View2 *acc=[[View2 alloc]initWithNibName:@"View2" bundle:nil]; View3 *four=[[View3 alloc]initWithNibName:@"View3" bundle:nil]; View4 *five=[[View4 alloc]initWithNibName:@"View4" bundle:nil]; nav1=[[UINavigationController alloc]initWithRootViewController:report]; nav2=[[UINavigationController alloc]initWithRootViewController:template]; nav3=[[UINavigationController alloc]initWithRootViewController: acc]; nav4=[[UINavigationController alloc]initWithRootViewController:four]; nav5=[[UINavigationController alloc]initWithRootViewController:five]; UITabBarItem *item = [[UITabBarItem alloc] initWithTitle:@"Title" image:[UIImage imageNamed:@"singleicon.png"] tag:0]; UITabBarItem *item1 = [[UITabBarItem alloc] initWithTitle:@"Reports" image:[UIImage imageNamed:@"doubleicon.png"] […]

如何selecttabBar项目,以模态方式显示viewController

我有一个UITabBarController和5 UITabBarItem的应用程序。 我想为第三个标签栏项目(摄像头控制器)模态地启动视图控制器。 我试过这个代码: override func viewDidLoad() { super.viewDidLoad() self.presentViewController(self, animated: true, completion: nil) } 但我的应用程序崩溃。 我该怎么办?

如何隐藏标签栏并在屏幕上显示完整的桌面视图?

在我的应用程序的实现中,我有一个带有5个不同选项卡的TabBar控制器。 通过下面的代码隐藏我的标签栏后 – (void)hideTabBar { for(UIView *view in self.tabController.view.subviews) { if([view isKindOfClass:[UITabBar class]] || [view isKindOfClass:[UIButton class]]) { view.hidden = YES; } } } 我仍然看到我的tableview的底部被一个白色的矩形部分遮盖(以前由可见的tabbar占用) 例如,在我隐藏标签栏之前 当我隐藏标签栏后,tableview仍然没有完全显示在屏幕上,底部仍然被一个白色的矩形空间占用(以前由标签栏占用 如上所述,我怎样才能隐藏tabbar,并确保整个tableview显示在我的屏幕上?

didSelectViewController方法不被调用(与故事板)

我有一个选项卡的ios5应用程序的2个版本,一个使用故事板和一个使用xib文件创build。 故事板版本不调用UITabBarControllerDelegate方法didSelectViewController (xib版本)。 故事板上有一些东西(我认为)缺失,但是我不知道是什么。 另一个框架问题的方法可能是 – 我怎样才能引用由故事板实例化的UITabBarController对象? 谢谢你的帮助。 编辑:标签栏控制器委托设置: 在AppDelegate.h中: @interface MyAppDelegate : UIResponder <UIApplicationDelegate, UITabBarControllerDelegate> @property (strong, nonatomic) UITabBarController *tabBarController; 在AppDelegate.m中: – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.tabBarController.delegate = self; return YES; } 然后在AppDelegate.m中,委托方法是: – (void) tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController { NSLog(@"Got Here"); } NSLog输出从不出现。 这个问题在我看来是,我没有正确引用由故事板实例化的标签栏控制器对象。 我怎么做?

如何加载UITabBarController中的所有视图?

我没有find有关这个问题的相关post和最新的答案。 我想在启动时加载所有的视图控制器。 目前它按预期启动,但是当我点击一个酒吧项目时(第一次),由于它尚未被加载,所以稍微延迟加载它。 我怎样才能做到这一点是斯威夫特? 谢谢。

tableView didSelectRowAtIndexPath在iOS 7上无法正常工作。为什么?

首先,我想说我只是提出这个问题,因为我想了解发生了什么。 我在Xcode5上全新安装了一个旧的Xcode项目(一个非常简单的项目)。 当我意识到它不适用于iOS 7.为什么? 不知道.. 我看到其他一些问题,没有得到任何有用的答案,所以我做了一个简单的testing。 在UITableViewController除了didSelectRowAtIndexPath之外,所有工作都正常 一探究竟 RootViewController.h: @interface RootViewController : UITableViewController @property (strong, nonatomic) NSMutableArray *items; @end RootViewController.m在viewDidLoad我初始化数组(有一些string)。 实现dataSource和委托方法(是的,我把委托和数据源设置为tableView) – (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } – (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [_items count]; } – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if […]