uinavigationbar

iOS 8 NavigationBar BackgroundImage

本秂侑毒 提交于 2019-11-29 20:30:50
With iOS 8 the concept of just iPhone and iPad sizes along with portrait and landscape have changed and therefor setting the navigation bars background image isn't working the same. Currently i'm using the following code: UIImage *NavigationPortraitBackground = [[UIImage imageNamed:@"nav-image-portrait"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)]; UIImage *NavigationLandscapeBackground = [[UIImage imageNamed:@"nav-image-landscape"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)]; [[UINavigationBar appearance] setBackgroundImage:NavigationPortraitBackground

UINavigationBar Rounded Two Corners

女生的网名这么多〃 提交于 2019-11-29 20:02:02
I want to round the top right and top left of the UINavigationBar. I know that there are functions for changing the views corner radius, but is it possible to do something similar to the standard UINavigationBar? If you don't know what I'm talking about, check out this: Thanks! The best way is to override drawRect in UINavigationBar and use a custom image. the following code works for me (tested on iOS5). The following code rounds the top left/right corners of the main navigation bar. Additionally, it adds a shadow to it: CALayer *capa = [self.navigationController navigationBar].layer; [capa

Adding image to navigation bar

…衆ロ難τιáo~ 提交于 2019-11-29 19:45:00
I'd like an image to take up all of a navigation bar. This is the navigation that comes with a navigation based app. It appears on the RootViewController with the accompanying UITableView. I've seen some examples of how this might work. Set navigation bar title: UIImage *image = [UIImage imageNamed:@"TableviewCellLightBlue.png"]; UIImageView *imageView = [[UIImageView alloc] initWithImage:image]; [self.navigationController.navigationBar.topItem setTitleView:imageView]; The problem there is it only covers the title rather than the entire navigation bar. There is also this thread: http:/

UITableView goes under translucent Navigation Bar

泄露秘密 提交于 2019-11-29 19:42:29
I am trying to have a transparent navigation bar in IOS 7 app. There is a full screen image in my application. I am also having a UITableView over that image. When I use the code below, image fits the screen as I want but UITableView goes under navigation bar. in viewDidLoad i use self.navigationController.navigationBar.shadowImage = [UIImage new]; self.navigationController.navigationBar.translucent = YES; self.navigationController.view.backgroundColor = [UIColor clearColor]; it is being ok when I change to self.navigationController.navigationBar.translucent = NO; but then I lose transparency

Navigation bar title bug with interactivePopGestureRecognizer

扶醉桌前 提交于 2019-11-29 19:27:56
I am having a weird problem with UINavigationBar 's title in an app when interactivePopGestureRecognizer comes into play. I have made a demo app to showcase this bug. Setup: The rootViewController is a UINavigationController . FirstViewController has the navigation bar hidden, and interactivePopGestureRecognizer.enabled = NO; Second and ThirdViewController s have the navigation bar visible and the popgesture enabled. Bug: The bug occurs when going back from the Second to the First view using the popgesture. If you pull the second view halfway and then go back to the second view, the navigation

Content falls beneath navigation bar when embedded in custom container view controller.

穿精又带淫゛_ 提交于 2019-11-29 19:05:12
UPDATE Based on Tim's answer, I implemented the following in each view controller that had a scrollview (or subclass) that was part of my custom container: - (void)didMoveToParentViewController:(UIViewController *)parent { if (parent) { CGFloat top = parent.topLayoutGuide.length; CGFloat bottom = parent.bottomLayoutGuide.length; // this is the most important part here, because the first view controller added // never had the layout issue, it was always the second. if we applied these // edge insets to the first view controller, then it would lay out incorrectly. // first detect if it's laid

iOS: Removing UINavigationBar animation

大城市里の小女人 提交于 2019-11-29 18:04:17
Our app has an UINavigationBar with an image on it. When we segue (push) to another screen then click the back button the image on the Navigation Bar seems to animate from left to right as it reappears. This is a little distracting. How can you remove this back button animation? We tried changing the segue Animates setting but this changes both the push animation and not the back animation. Our Nav Bar code: let logoImage:UIImage = UIImage(named: "ABC")! viewController.navigationItem.titleView = UIImageView(image: logoImage) Marcus Leon Figured this out in large part due to this answer https:/

Creating a UIBarButton Centered Programmatically

淺唱寂寞╮ 提交于 2019-11-29 17:34:55
I have an array of bar buttons that I normally set with something like: NSArray *leftButtonArray = [[NSArray alloc]initWithObjects: backBarButton, separator1,postBarButton, separator1, memeBarButton, separator1, pollBarButton, nil]; self.navigationItem.leftBarButtonItems = leftButtonArray; However, I want to change these buttons on the left to instead be center aligned. Anyone know how I can do that? Providing an example or using my buttons to do so would be a plus. Thanks! As I understand your problem it required to have some button to left, some on middle, and some on right with relative

Add another button next to the “back” button on the left of a UINavigationBar

送分小仙女□ 提交于 2019-11-29 17:12:56
问题 I've tried this for hours but I still cannot solve it. When using UINavigationController and push a new view controller on top, I got a free "back" button on the left of the navigation bar. I want another button just next to it (to show a popover menu). I wonder what is the correct way to do that. Or I have to hide the free back button and make the same one by myself? If that's the case, I also need to pop the current view controller when pressing my own back button, right? Thanks for your

How can I get the color and translucency of the iOS 10 watch Navigation Bar?

£可爱£侵袭症+ 提交于 2019-11-29 16:59:11
I am looking to get the translucency and color of the iOS 10 watch navigation bar. I managed the color by color picking the RGB but I cannot figure out the translucency. I am using Swift 3, can anyone tell me how to get the translucency? I have circled what translucency I'm looking for. Please provide the code if you can. Use below method to achieve navigationBar translucent effect . When UIContentView scrolls as the picture you posted. In viewDidLoad: view.backgroundColor = UIColor.black navigationController?.navigationBar.barStyle = UIBarStyle.blackTranslucent navigationController?