uinavigationbar

Prevent UINavigationBar popViewController animation

筅森魡賤 提交于 2019-12-12 08:58:33
问题 I have the following problem: I have overridden popViewControllerAnimated:(BOOL)animated of UINavigationController because I would like to have a custom animation. The code is as follows: - (UIViewController *)popViewControllerAnimated:(BOOL)animated { UIViewController *poppedCtrl = [super popViewControllerAnimated:NO]; [((customViewController *) self.topViewController) doCustomAnimation]; return poppedCtrl; } Unfortunately the UINavigationBar seems to ignore that I explicitly disable the

How do you determine the size/frame of a custom UINavigationItem.titleView?

Deadly 提交于 2019-12-12 08:53:46
问题 After creating a custom view and assigning it to the navigationItem.titleView property it is displayed like this with the custom view filling the space between the two buttons. Therefore, the custom view is not centered on the navigation bar. How do I determine the frame of the view in the .titleView property? I want to center some text in the navigation bar, say under the time stamp. 回答1: If you really want to get titleView 's frame (in your top-level view's coordinate space), you can do

Custom background for UINavigationBar in landscape mode

爷,独闯天下 提交于 2019-12-12 08:41:19
问题 I am adding a custom background for my UINavigationBar. It works fine as long as the phone is in portrait mode. As soon as I switch to landscape mode, half the bar appears blue (the default navbar color) and half of it has my image How can I stretch the image for landscape mode and make it small again for portrait mode? Thanks Solution Incase anyone is looking for an answer to how to add an image to navigation bar - here goes UIImageView *imgView = [[UIImageView alloc] initWithFrame

ios7 UINavigationBar stops extending under status bar after a while

≡放荡痞女 提交于 2019-12-12 08:26:39
问题 First of all - this is NOT a question about navigation bar overlapping status bar (as many others). UINavigationBar (of my navigation controller) is perfectly aligned as I want. The problem is with my navigation bar custom background. Background image (or navigation bar itself) stops expending under status bar randomly (after few seconds after my application starts or when I present / dismiss modal navigation controllers over it). My custom image has proper dimensions for iOS (640x128px). 1.

Translucent Status Bar with No Navigation Bar

一曲冷凌霜 提交于 2019-12-12 07:14:15
问题 Goal: To have a table view scroll so that it shows semitransparent under the status bar while not displaying a navigation bar. Right now, I have my tableView set to the top anchor (so technically underneath the status bar). This sets the status bar to a solid looking color as you scroll up on the table view. I've set the navigationAppearance's barTintColor and translucent to YES with no luck. Any ideas? The view is instantiated in a storyboard 回答1: Your question is hard to guess without any

Semitransparent background image (PNG24) for UINavigationBar only shows transparent after rotation

南楼画角 提交于 2019-12-12 06:23:54
问题 I'm using a category to implement a custom background for UINavigationBar . @implementation UINavigationBar (UINavigationBarCategory) - (void)drawRect:(CGRect)rect { UIImage *img = [UIImage imageNamed: @"TopNav-YellowRule.png"]; [img drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)]; } @end The image that I am using is a semitransparent PNG24. When the app loads the background of the UINavigationBar shows up just fine but is not semitransparent - I cannot see the

How to add bar button to uinavigationbar in iphone

柔情痞子 提交于 2019-12-12 05:39:42
问题 My class is a normal view controller and I added a navigation bar through IB and i am adding a barbutton item on left to the navigation bar programmatically using the following code UIBarButtonItem *addButton1 = [[UIBarButtonItem alloc] initWithTitle:@"Start" style:UIBarButtonItemStylePlain target:self action:@selector(tourBtnClicked:)]; self.navigationItem.leftBarButtonItem = addButton1; but its not working... should i add the navigationbar also programmatically or should my class a

iOS. How to change UINavigationBar height and change frames of the others subviews at once?

蹲街弑〆低调 提交于 2019-12-12 05:34:51
问题 I use navigation-based application and for example have some viewControllers with UITableView . if I change the UINavigationBar height then I must change the frames of the other elements manually for each viewController . Are there any common solutions of this problem? 来源: https://stackoverflow.com/questions/8267349/ios-how-to-change-uinavigationbar-height-and-change-frames-of-the-others-subvie

Setting status bar hidden is messing with my navigation bar background image size

。_饼干妹妹 提交于 2019-12-12 04:48:37
问题 In my app I want to change only one view controller status bat to hidden. So in the view did load method I added this: - (BOOL)prefersStatusBarHidden { return YES; } Thats what allot of the guides online said to do. Now, this view controller is a table view, and I have set its nav bar background image to something custom, it looks like this before Im hiding the status bar: And after I added the hidden method: So you can see it cuts part of the bg image (with the green line). my nav bar bg

changing the direction that the hide animation moves a navigationBar

余生颓废 提交于 2019-12-12 04:23:18
问题 When I try to hide the navigationBar, I found the hide animation sometimes moves sideways (the bar moves to left and disappear) but sometimes moves upward. Is there a way to make sure animation (hide) always goes upward? Thanks! 来源: https://stackoverflow.com/questions/5076809/changing-the-direction-that-the-hide-animation-moves-a-navigationbar