- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在应用程序中处理 UINavigationControllers
,所有这些都由 UITabBarController
处理。一切工作正常,直到我的 Controller 落入自动生成的“更多”选项卡。
我在简单的示例中重现了该问题。难道我做错了什么?我想不通。
感谢您的帮助。
#import <UIKit/UIKit.h>@interface testAppDelegate : NSObject <UIApplicationDelegate, UITabBarControllerDelegate>{ UIWindow *window; UITabBarController *tabBarController;}@property (nonatomic, retain) IBOutlet UIWindow *window;@property (nonatomic, retain) IBOutlet UITabBarController *tabBarController;@end@implementation testAppDelegate@synthesize window, tabBarController;- (void)applicationDidFinishLaunching:(UIApplication *)application{ tabBarController = [[UITabBarController alloc] initWithNibName:nil bundle:nil]; UINavigationController *ctrl1 = [[[UINavigationController alloc] initWithNibName:nil bundle: nil] autorelease]; ctrl1.tabBarItem = [[[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemFeatured tag:1] autorelease]; UINavigationController *ctrl2 = [[[UINavigationController alloc] initWithNibName:nil bundle: nil] autorelease]; ctrl2.tabBarItem = [[[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemFavorites tag:2] autorelease]; UINavigationController *ctrl3 = [[[UINavigationController alloc] initWithNibName:nil bundle: nil] autorelease]; ctrl3.tabBarItem = [[[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemBookmarks tag:3] autorelease]; UINavigationController *ctrl4 = [[[UINavigationController alloc] initWithNibName:nil bundle: nil] autorelease]; ctrl4.tabBarItem = [[[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemContacts tag:4] autorelease]; // This one won't work UINavigationController *ctrl5 = [[[UINavigationController alloc] initWithNibName:nil bundle: nil] autorelease]; ctrl5.tabBarItem = [[[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemMostRecent tag:5] autorelease]; // This one will work UIViewController *ctrl6 = [[[UIViewController alloc] initWithNibName:nil bundle: nil] autorelease]; ctrl6.tabBarItem = [[[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemDownloads tag:6] autorelease]; tabBarController.viewControllers = [NSArray arrayWithObjects:ctrl1, ctrl2, ctrl3, ctrl4, ctrl5, ctrl6, nil]; [window addSubview:tabBarController.view]; [window makeKeyAndVisible];}- (void)dealloc{ [tabBarController release]; [window release]; [super dealloc];}@end
最佳答案
简短回答:不能嵌套导航 Controller
更长的答案:你做错了。创建您想要的内容的更好方法如下:
NSMutableArray *viewControllers = [NSMutableArray array];
[viewControllers addObject:[[[ConverterViewController alloc] init] autorelease]];
[viewControllers addObject:[[[UINavigationController alloc]
initWithRootViewController:[[[CurrencyViewController alloc] init] autorelease]] autorelease]];
[viewControllers addObject:[[[UINavigationController alloc]
initWithRootViewController:[[[HistoryViewController alloc] init] autorelease]] autorelease]];
[viewControllers addObject:[[[UINavigationController alloc]
initWithRootViewController:[[[SetupViewController alloc] init] autorelease]] autorelease]];
[viewControllers addObject:[[[UINavigationController alloc]
initWithRootViewController:[[[HelpViewController alloc] init] autorelease]] autorelease]];
[viewControllers addObject:[[[LinksViewController alloc] init] autorelease]];
self.viewControllers = viewControllers;
self.customizableViewControllers = [viewControllers arrayByRemovingFirstObject];
@implementation HelpViewController
#pragma mark -
#pragma mark Initialization
- (id)init
{
if ((self = [super initWithNibName:@"HelpView" bundle:nil]) != nil) {
self.title = NSLocalizedString(@"Help", @"Help");
self.tabBarItem.image = [UIImage imageNamed:@"question.png"];
}
return self;
}
关于iphone - UINavigationController 在 UITabBarController 的 moreNavigationController 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1380503/
我正在开发一个广播流应用程序,应用程序底部有 2 个 UITabBarController 按钮。一种用于直播,一种用于前 40 名列表。 我为这两个选项卡使用了一个通用的 StreamingView
我有一个 UINavigationController在我的 UITabBarController 的根目录中.我还有一个 UITabBarController我现在在现有的 UITabBarCont
我最近升级到 xcode 4。我的应用程序使用 tabbarcontroller。在旧的 xcode 3.x 中,您可以根据此屏幕截图将选项卡更改为不同类型: 根据我在研究此问题时收集到的信息,xco
我使用包含 3 个项目的 Storyboard创建了一个 UITabBarController,前两个是 View Controller 。我需要第三项指向另一个 UITabBarController
好的,这就是场景: 我有一个选项卡栏应用程序,每个选项卡中都有一个 UINavigationController。假设我有两个选项卡:“主页”和“退出”。在“主页”中,用户遵循基于 UINavigat
我有自己的 UITabBarViewController 子类。是否可以更改所有嵌入式 View Controller View 的框架,以便自己的 UITabBarViewController Vi
滚动时选择顶部的菜单项。我希望用户突出显示一个项目,然后单击它以选择它。 -> 当用户移动到其他菜单项时,选定的蓝色会随之移动(跟随光标)。如果用户单击该项目,则选定的蓝色将被新项目替换,如果不是在用
我正在尝试以编程方式更改我的应用程序中标签栏项目的名称。 在我的 Storyboard 我有一个 UITabBarController 设置为初始 View ,层次结构如下: UITabBarCont
我正在使用包含 3 个项目的 UITabBarController,并且很好奇如果我位于第二个或第三个选项卡上,如何从第一个选项卡访问方法。我遇到的问题是我在第一个选项卡上有一个 UIImageVie
我希望在 iOS 中实现一个自定义选项卡栏,其中所选项目的尺寸大于其余选项卡的大小,并查看类似于此屏幕截图的内容。 有人可以指出如何最好在 Swift 中完成此任务的教程吗? 最佳答案 我多次面临这个
我正在制作一个自定义的东西,它的工作方式应该与 UITabBarController 类似——一个管理子 ViewController 的 UIViewController。父 UIViewContr
我有一个 viewController,它正在作为 UITabBarController 上的选项卡加载。 我如何知道在 viewController 类中,有多少区域可用于显示此 viewContr
我想在UITabbarController中输入一个按钮来处理事件作为instagram应用程序的标签栏。 此链接中的图片: http://itunes.apple.com/us/app/instag
我有一个 UIViewController,其中包含一个带有三个选项卡的 UITabBarController(每个选项卡都是一个 UINavigationController)。 我遇到的问题是,在
我在使用 UITabBarController 时遇到了真正的问题。我追求的结果如下:1)在纵向模式下,一个简单的基于选项卡栏的应用程序(带有导航栏)没什么特别的。2)在横向模式下,我想使用自己的 U
UITabBarController 不允许横向。所以我使用了 UITabBarContoller 的子类(称为 RotatingTabBarController)。其唯一目的是通过向 shouldA
是否可以用动画隐藏它? 最佳答案 UITabBar 继承自 UIView,因此您可以像使用标准 UIView 一样隐藏它并为其设置动画。 - (void) hideTheTabBarWithAnima
UITabBarController是否可以在代码中选择选项卡?就像UINavigationController一样我们可以使用popViewController弹回rootViewControlle
我需要更改 UITabBarController 的“更多”按钮显示的列表的字体大小和背景颜色。是否可以 ?我该怎么做 ?非常感谢。 最佳答案 UITabBarController 有一个名为 mor
我正在尝试将股票UITabBar的高度更改为44px,类似于Tweetbot的标签栏高度。我也看到其他一些应用程序也可以这样做。 但是,当我尝试设置高度时,它仍然保持不变 self.tabBar.fr
我是一名优秀的程序员,十分优秀!