uinavigationbar

How to create navigation bar item in the custom Navigation Bar in iPhone?

被刻印的时光 ゝ 提交于 2019-12-08 02:36:27
问题 I have created one custom view and added a web view as subview of that custom view. And i have created one navigation bar in programmatically. Now i want to create one Left or Right navigation bar buttons in that view. navigBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)]; navigBar.tintColor = [UIColor blackColor]; [self.view addSubview:navigBar]; UIBarButtonItem *homeButton = [[UIBarButtonItem alloc] initWithTitle:@"Home" style:UIBarButtonSystemItemAction target:self

back navigationItem with title & background image

笑着哭i 提交于 2019-12-08 02:21:51
问题 I know how to add back navigation button with image or change the tile but I haven't seen any example with background image and its title ( @"back" ). Can I add a custom UIButton with custom background image and title? 回答1: This, what I finally did in my code actually works!!! Just update "forState" and "barMetrics" values for different appearances. [[UIBarButtonItem appearance] setBackButtonBackgroundImage:[UIImage imageNamed:@"myImage"] forState:UIControlStateNormal barMetrics

Setting the background color of UINavigationBar has no effect?

家住魔仙堡 提交于 2019-12-08 01:36:56
问题 For most iOS widgets I can set the background color. It appears that UINavigationBar is not this way. Furthermore I cannot set the navigation item (top item)'s background as it does not respond to setBackgroundColor. How can I change that color? Thanks. 回答1: You should use setTintColor: instead: [self.navigationController.navigationBar setTintColor:[UIColor redColor]]; Hope this helps! 回答2: Change it by following code: self.navigationController.navigationBar.tintColor=[UIColor grayColor]; 回答3

How to hide status bar in iOS 7?

末鹿安然 提交于 2019-12-08 01:34:22
问题 I have tried setting the following in my app .plist file: View controller-based status bar appearance: NO And while this removes it from my initial view controller, once I go to another view and come back with my navigation controller, it comes right back and this time it does not disappear. Also, I don't see why it would matter but I have also set the status bar under simulated metrics to "None" but that doesn't seem to help. I know i am going to have the navigation bar but the status bar I

Changing back button background image

拈花ヽ惹草 提交于 2019-12-08 00:42:33
问题 Using this method to change title and background image of the back navigation button. Title is changed but button stays black - (void)viewDidLoad { [super viewDidLoad]; [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"topBarbackground.png"] forBarMetrics:UIBarMetricsDefault]; UIBarButtonItem *backButton = [UIBarButtonItem new]; [backButton setBackgroundImage:[UIImage imageNamed:@"backButton.png"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];

After NavigationBar Hide on Swipe, Cells appear between HeaderCell & Status Bar for a second

旧时模样 提交于 2019-12-08 00:02:06
问题 Edit: I tried adding in AppDelegate DidFinishLaunch.. let view: UIView = UIView.init(frame: CGRectMake(0, 0, UIScreen.mainScreen().bounds.size.width, 25)) view.backgroundColor = UIColor.redColor() view.alpha = 1 self.window!.rootViewController!.view.addSubview(view) After I changed the Status Bar to red, I prevented it going under status bar, but I realised that it wasn't just the Status Bar and there was something going on with the Navigation Bar while it gets swiped away. The content cells

Hide navbar in mobile browsers

邮差的信 提交于 2019-12-07 19:56:56
问题 I'm making a mobile responsive site using Twitter Bootstrap. I'd like to completely hide the top navbar when the site is viewed on mobile. Anyone know a way to do this? 回答1: The easiest way is to use the responsive utility classes .hidden-phone and .hidden-tablet <div class="navbar hidden-tablet hidden-phone"> You could also use a media query such as.. @media (max-width: 767px) { .navbar{ display:none; } } More on responsive classes here: http://twitter.github.io/bootstrap/scaffolding.html

iPhone/Objective-C - Change default “navigationItem.prompt” color

∥☆過路亽.° 提交于 2019-12-07 18:56:59
问题 Is there a way to set the self.navigationItem.prompt color to White? At the moment it's Black. This is how I'm setting my navigationBar color at the moment: // Set top navigation bar. UINavigationBar *bar = [navController navigationBar]; [bar setTintColor:[UIColor colorWithRed:180.0/255.0 green:25.0/255.0 blue:34.0/255.0 alpha:1]]; UIImageView *navBar = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 44)]; [navBar release]; ..and this is how I'm setting my navigationItem.prompt :

Change the default font of Back button in UINavigationController

给你一囗甜甜゛ 提交于 2019-12-07 16:47:37
问题 I am trying to change the default font of Back button in UINavigationController to a custom font UIFont *myCustomFont = [UIFont fontWithName:@"MyCustomFont" size:18]; How can I set this custom font to the Back Button? I've browsed through other answers to similar questions in this site with no success. 回答1: [[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], nil] setTitleTextAttributes: @{UITextAttributeTextColor:[UIColor blackColor], UITextAttributeTextShadowOffset:[NSValue

Stop Navigation Controller from affecting other View Controllers

纵然是瞬间 提交于 2019-12-07 16:39:17
问题 I have an app that uses a Navigation Controller with three View Controllers for step-by-step user setup. So the first View would be Step 1, second Step 2, and etc. And all this would be embedded in a Navigation Controller so the user would be able to go back and forth. However, once this setup is done and the user presses the 'Done' button, the app programmatically moves to another section of the storyboard which is supposed to be separate from the initial setup. I programmatically segue to