uinavigationbar

Objective C: How to make Navigation bar scroll with tableview

拟墨画扇 提交于 2019-12-03 04:04:16
I have a UITableView and a navigation bar in a single screen of my app. I want to navigation bar to be scrolled together with the rest of the table. Note: I am currently implementing a UITableView that is added as a subview of a uiviewcontroller which is in turn part of a navigation controller Can anyone advise me on how to do this? In the following answer I'm hiding the real nav bar and replacing it with a fake bar. If you want to use the real nav bar instead, the code is still valid, just restore the original position of the bar in viewWillDisappear. Hide the navigation controller bar: self

Subclassing UINavigationBar … how do I use it in UINavigationController?

假如想象 提交于 2019-12-03 03:59:54
I wanted to subclass UINavigationBar (to set a custom background image & text color) and use that for all the navigation bars in my app. Looking at the API docs for UINavigationController, it looks like navigationBar is read-only: @property(nonatomic, readonly) UINavigationBar *navigationBar Is there a way to actually use a custom UINavigationBar in my UIViewControllers? I know that other apps have done custom navigation bars, like flickr: http://img.skitch.com/20100520-bpxjaca11h5xne5yakjdc2m6xx.png Here is my UINavigationBar subclass: #import <UIKit/UIKit.h> @interface MyNavigationBar :

Custom logo on top of UINavigationBar?

自闭症网瘾萝莉.ら 提交于 2019-12-03 03:58:23
I've read plenty of requests about a full-on custom UINavigationBar background, but what I want is to overlay a logo on the default UINavigationBar instead of text. Preferably, I'd like to apply it to a subclass of UINavigationBar called CustomNavigationBar. Neat tricks, Shadow. If you just want to add a logo instead of a title, that's easy. Set the titleView on your navigationItem, like so: UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Logo"]]; self.navigationItem.titleView = imageView; [imageView release]; Kaili This page has some code you can look at as

How can I set custom font in UINavigationBar?

心已入冬 提交于 2019-12-03 03:35:03
How can I set custom font in UINavigationBar ? I need the tahoma font. - (void)viewDidLoad{ self.title =@"My text"; } Totally possible, if a little tricky to do. Once you've found the font you need (either one of the alternatives already shipped with iOS, or a TTF file that you've got the correct licensing for), just create a UILabel with the size, formatting, font etc and then add it to the navigation items for that bar (or, if you're doing this in a view controller, set the .navigationItem.titleView of that controller to your label). For example, I have a view controller inside a

How to add UIBarButtonItem to NavigationBar while using UIPageViewController

帅比萌擦擦* 提交于 2019-12-03 03:32:38
Please forgive me, there are already a ton of questions on how to add a UIBarButtonItem to a NavigationBar programmatically but I just can't seem to get any of the solutions to work in my situation. Here is the layout of a simple test app I have been working with to learn the UIPageViewController. I have the page view controller working nicely with three unique viewControllers. I would now like to set unique rightBarButtonItems for each of the view controllers. I can easily set a common barButtonItem in the DetailViewController by simply doing this. UIBarButtonItem *newButton = [

ios 7 UiView frame issue

匆匆过客 提交于 2019-12-03 03:05:06
问题 I am running same app in iOS6 and iOS7 which has NavigationBar.It runs well on iOS6, but in iOS7, all view is little bit up like it is not considering the Navigation bar at all. I have tried changing topbar property in simulated metrics option but it doesnt work. It considers button's position from NavigationBar in iOS6, but in iOS7, it considers it from top of the screen. What is the reason for it? Thanks in advance. 回答1: You should use below line for fix it in your view. self

Touch events within ~8 pixels of nav bar not called

白昼怎懂夜的黑 提交于 2019-12-03 02:58:55
I have an application with three buttons (actually UIView 's) laid out horizontally underneath the navigation bar. The three buttons are of substantial enough size (larger than the back button, for example), however they won't respond to touches when the hit is in the top third part, roughly. I'm aware that this area directly underneath the nav bar is sort of 'reserved' for the back button and other UINavigation items having a touch area that expands beyond the navigation bar (by quite a significant margin), however in some instance there isn't even a navigation item nearby to steal the event,

iOS 7, corrupt UINavigationBar when swiping back fast using the default interactivePopGestureRecognizer

旧巷老猫 提交于 2019-12-03 02:36:59
问题 I have an issue that I'm stuck on, but I have no idea why it even happens; If I push a detail controller on the stack, and I swipe back very quickly using the default left edge interactivePopGestureRecognizer , my parent/root view controller's UINavigationBar looks corrupt or something, almost like the built in iOS transition mechanism didn't have time to do it's job at resetting it after the detail view is gone. Also to clarify, everything in this 'corrupt' UINavigationBar is still touchable

Transitioning between transparent navigation bar to translucent

我的梦境 提交于 2019-12-03 01:56:27
问题 In Apple's recently released Remote app I noticed the way in which the navigation bar behaves is unique and I haven't been able reproduce it. When popping the Now Playing view controller the navigation bar remains transparent for the Now Playing view controller and the navigation bar for the library view controller also stays translucent (Screenshot 1). I'm trying to figure out if they are using two navigation controllers or only one. Personally I feel they're using just one for two reasons

UINavigationBar Text Color in Swift

点点圈 提交于 2019-12-03 01:49:01
问题 How would I go about changing the color of the UINavigationBar in Swift? Most things online say to do something like: [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor]}]; Which I translated to let titleDict: NSDictionary = ["NSForegroundColorAttributeName": UIColor.whiteColor()] self.navigationController.navigationBartitleTextAttributes = titleDict //self is referring to a UIViewController But it doesn't work. I already