Tag: uinavigationbar

应用生命周期问题

我已经做了导航栏的变化意味着我已经增加了导航栏的高度,并作出了一些自定义的变化,它工作正常,但是当我最小化应用程序,并再次最大化,它只显示原始高度是我做了什么变化,那些不最小化后工作,我的代码是 – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { NSLog(@" im in didFinishLaunchingWithOptions" ); [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"TopHeader"] forBarMetrics:UIBarMetricsDefault]; [[UINavigationBar appearance] setFrame:CGRectMake(0, 0, 320, 55)]; [[UINavigationBar appearance] setTitleVerticalPositionAdjustment:(-15.0) forBarMetrics:UIBarMetricsDefault]; [[UINavigationBar appearance] setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys: [UIColor colorWithRed:245.0/255.0 green:245.0/255.0 blue:245.0/255.0 alpha:1.0], UITextAttributeTextColor, [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.8],UITextAttributeTextShadowColor, [NSValue valueWithUIOffset:UIOffsetMake(0, 1)], UITextAttributeTextShadowOffset, [UIFont fontWithName:@"HelveticaNeue-CondensedBlack" size:16.0], UITextAttributeFont, nil]]; return YES; } […]

如果同时触发滑动手势和后退button,则导航栏会变得时髦

今天我们的一个testing人员告诉我,如果他按下导航栏的后退button的同时向后滑动,则会在导航栏中创build一个非常有趣的行为: 如果我们在第三个视图控制器上,并执行此操作比返回顶部,再次进入一个级别,并在大多数情况下单击后退button导航栏不会消失,如果它应该,或者它可能不会animation。 或者不在更深层次上出现。 或者取消激活后退button,尽pipe不在顶部视图控制器中。 有时这些消息被打印到控制台: 完成处于意外状态的导航转换。 导航栏子视图树可能会损坏。 事实certificate,它必须在苹果类,因为我能够用简单的课程重现它。 代码在GitHub上 。 您将不得不在手机上运行应用程序来一次执行手势和button点击。 我也准备了一个video 。 我如何解决它?

导航栏后面的search栏

给定3个控制器:A,B,C A有一个隐藏的导航栏。 通过StoryboardReference调用控制器B. 控制器B在viewDidLoad上显示导航栏。 它有一个search栏和一个collectionView。 看到我的故事板截图A. 调用控制器C如果一个单元格被点击。 问题:如果A调用B,则search栏位于导航栏后面(屏幕截图B)。 它从C到B的转换(截图C)出现。 导航栏已经是半透明的了。 有任何想法吗? 编辑 我意识到,我的animation过渡正在造成我的问题。 也许你可以发现错误? class ZoomInCircleViewTransition: NSObject, UIViewControllerAnimatedTransitioning, UIViewControllerTransitioningDelegate { var transitionContext: UIViewControllerContextTransitioning? func transitionDuration(transitionContext: UIViewControllerContextTransitioning?) -> NSTimeInterval { return 0.6 } func animateTransition(transitionContext: UIViewControllerContextTransitioning) { self.transitionContext = transitionContext guard let toViewController: UIViewController = transitionContext.viewControllerForKey(UITransitionContextToViewControllerKey) else { return } guard let fromViewController = transitionContext.viewControllerForKey(UITransitionContextFromViewControllerKey) else […]

如何使导航栏与我的网页一起滚动?

如何让导航栏隐藏,因为用户滚动? 我试图实现一个浏览器,如Safari移动应用程序。 注意: 我使用的是UIWebView而不是 UIScrollView。

当另一个viewController隐藏状态栏时,UINavigationBar在状态栏下移动

问题很简单,Profile viewController在状态栏下面有一个NavigationBar。 我推另一个viewController在当前之一。 这个新的viewController隐藏状态栏。 当我回到Profile viewController时,navigationBar已经向上移动了状态栏高度的大小。 我试图强制在我的viewWillAppear刷新布局,但它不工作。 有任何想法吗?

导航栏下的空白处

当self.navigationController.navigationBar.translucent = NO ,导航栏下会出现一个空白区域,如下所示: 我怎样才能删除它? // From above example (void)loadUI { [self.countriesButton setBackgroundColor:[UIColor colorWithRed:(243/255.0) green:(178/255.0) blue:(128/255.0) alpha:1]]; [self.countriesButton.layer setCornerRadius:10]; [self.countriesButton setClipsToBounds:YES]; /// set attributes for Navigation Bar self.navigationItem.title = @"Welcome"; // Title of Navigation Bar self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:(243/255.0) green:(178/255.0) blue:(128/255.0) alpha:1]; self.navigationController.navigationBar.tintColor = [UIColor whiteColor]; self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName : [UIColor whiteColor]}; self.navigationController.navigationBar.translucent = NO; […]

使用UINavigationController视图

我想更好地理解使用UINavigationController的。 我已经使用UINavigationViewController以及其他两个视图控制器设置了一个新项目。 在我的应用程序委托中,我有以下几点: self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. self.window.backgroundColor = [UIColor whiteColor]; firstViewController = [[NCTFirstViewController alloc] initWithNibName:@"NCTFirstViewController" bundle:nil]; navController = [[NCTNavViewController alloc] initWithRootViewController:firstViewController]; self.window.rootViewController = self.navController; [self.window makeKeyAndVisible]; 在我的UINavigationController.m文件中,我可以设置标题并设置button,但这不起作用。 这只适用于如果我在实际的视图控制器本身设置self.navigtionController项目。 这是正确的,或者有什么我应该在UINavigationController做这个工作。 理想情况下,我正在寻找一个UINavigationController处理所有推送到其他控制器。 从长远来看,它将被用作菜单系统。 所以如果用户点击顶部的一个button,它们被推送到一个新的视图控制器,但没有后退选项,只是在顶部的导航栏中显示一个新的中央视图控制器相同的菜单项。 我遇到的问题是了解如何设置。 如果我必须在视图控制器本身设置它,他们都不会重复相同的代码。 当然,我可以在AppDelegate中设置所有的“移动”,但是这看起来不正确,并且会收起App Delegate本身。

在iOS 7中,长按屏幕标题缺lessbutton标题

当我的屏幕标题很大时,我看到“返回”button标题丢失。 我需要显示整个标题。 有没有解决方法? 请参阅附上我看到与长标题的导航栏的屏幕截图。

UIBarButton不会显示在我的UINavigationController中

我想用一个导航栏和一个表格视图做一个简单的视图。 所以我创build了一个UINavigationController的子类,并在其中添加了一个UITableView 。 我的也是UITableViewDataSource和UITableViewDelegate 。 现在我想添加UIBarButton在导航栏,但它不工作: UIBarButtonItem *anotherButton = [[UIBarButtonItem alloc] initWithTitle:[[Translator instance] getTranslation:@"Back"] style:UIBarButtonItemStylePlain target:self.parentViewController action:@selector(dismissFiltersModal:)]; self.navigationItem.backBarButtonItem = anotherButton; 显示视图没有错误,但没有button。 我该如何显示呢?

自定义rightBarButtonItem消失

我在NavBar中有一个自定义的RightBarButtomItem的奇怪的错误。 我有一个TabBar应用程序。 如果该应用程序已加载button显示正确。 如果我点击标签button不断显示。 如果我回到已经显示的标签之一,button消失。 最后,button只在其中一个标签中随机显示。 我的代码完美工作,如果我设置一个标准的rightBarButtomItem编程。 但不是自定义graphics。 如果一个ChildViewController被按下并popup,该button再次出现。 它似乎仍然存在但不可见! 我认为我在CustomTabBarViewController中的sharedRightButton的引用是错误的! 任何人都可以帮忙吗? CustomTabBarController.h #import <UIKit/UIKit.h> #import "EZBadgeView.h" @interface CustomTabBarController : UITabBarController { EZBadgeView *badgeView; UIButton *btn; UIImage *rightBarButtonItemImage; UIImage *rightBarButtonItemImageTapped; UIImage *rightBarButtonItemImageSelected; } @property (nonatomic, strong) UIBarButtonItem *sharedRightButton; @property (nonatomic, strong) EZBadgeView *badgeView; @property(nonatomic, strong) UIButton *btn; @property(nonatomic, strong) UIImage *rightBarButtonItemImage; @property(nonatomic, strong) UIImage *rightBarButtonItemImageTapped; […]