uinavigationbar

UINavigationBar - Setting background image?

扶醉桌前 提交于 2019-12-11 12:18:12
问题 So I have a category for UINavigationController and I override the init method as below - (id)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { UIImage *image = [UIImage imageNamed:@"navBar.png"]; [[UINavigationBar appearance] setBackgroundImage:image forBarMetrics:UIBarMetricsDefault]; } return self; } The following code causes the background image of the navigation bar to become blank (white). The image name is correct and it exists within the project. Any idea what is

Status bar background color

只愿长相守 提交于 2019-12-11 11:53:27
问题 I am trying to make my status bar background color the same as my navigation bar, I was trying to find the answer in google but it does not work clearly for me... Can you please explain how it works and how can I fix it? 回答1: It looks to me like you have a UINavigationBar up there, which is what's causing the gap at the top. If you are able to, embed your view controller in a UINavigationController instead, then set your navigation item buttons in code. This gives you the same effect, but

Drawing in custom UINavigationBar, attached to top

戏子无情 提交于 2019-12-11 10:44:38
问题 I have a subclass of UINavigationBar . It's barPosition is UIBarPositionTopAttached . Than I override -(void)drawRect:(CGRect)rect in my subclass. The rect , that comes as parameter, has always 44 px height, and I can draw only inside this rect. So, I can't perform drawing over the status bar and it has default look. If I comment -drawRect out, than it looks as expected, navigation bar and status bar look as a whole and have 64 px height. Is there a way to achieve this effect with having

Animate UISearchBar and UIBarButtonItem simultaneously with UISearchController

[亡魂溺海] 提交于 2019-12-11 10:39:51
问题 I'm trying to reproduce a search interface similar to the one of the Maps app. I'm using a UISearchController with its searchBar inside my navigationBar . I also have a rightBarButtonItem on that navigation bar. By default, when presenting the search controller, the cancel button of the search bar shows next to the existing right item. What I want to do — like with the Maps app — is to hide my right navigation item while the searchController is presented and show it again when it's dismissed.

Add a custom button to UINavigationController subclass

喜你入骨 提交于 2019-12-11 10:26:35
问题 I am trying to customize the NavigationBar by subclassing the navigation controller. For some reason I can't get the custom button to show up. My setup is pretty straight forward I have a ViewController which is embedded into a Navigation Controller which uses my custom subclass NavController : @interface NavController () @end @implementation NavController - (void)viewDidLoad{ [super viewDidLoad]; UIImage *wlImage = [UIImage imageNamed:@"wl-icon.png"]; UIButton *wlButton = [UIButton

Facebook Share Button in navigation bar appears inactive

倾然丶 夕夏残阳落幕 提交于 2019-12-11 10:21:15
问题 I'm trying to implement FB Share Button to Navigation Bar(with it's design). I coded sharing with SLComposeViewController, and everything works fine. I use only Facebook and Action icon is not what i want. I tried to add a button as FBSDKShareButton to Navigation Bar: but button is always inactive and looks poor: I am sure, that I test my app on the device logged to FB. May be FBSDKShareButton needs some information about this? How? self.fbShareButton.enabled = true in viewDidLoad does not

Navigation Bar doesn't come back once it hides (swipe)

僤鯓⒐⒋嵵緔 提交于 2019-12-11 10:19:23
问题 I created a ViewController with TableView inside it and embedded it a NavigationController. I also set the constraints. On Swipe down, Navigation Bar hides. Everything seems fine. The only problem is that on Swipe Up, the Navigation Bar doesn't come back. If I use the same TableView with a TableViewController instead of ViewController (embedded from the same Navigation Controller), the Navigation Bar does comes back. For the ones wondering why I don't just go with the TableViewController,

UIPopoverController Nav Bar Appearance

泪湿孤枕 提交于 2019-12-11 09:57:05
问题 I am using this code to customise my nav bar image throughout my app. UIImage *navBarTexture = [[UIImage imageNamed:@"NavBarTexture_iPad"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)]; [[UINavigationBar appearance] setBackgroundImage:navBarTexture forBarMetrics:UIBarMetricsDefault]; [[UINavigationBar appearance] setBackgroundImage:navBarTexture forBarMetrics:UIBarMetricsLandscapePhone]; This works wonders. However, when using this image on the nav bar in UIPopoverControllers, it

Position of navigation buttons in RTL languages are not correct in iPad

谁说胖子不能爱 提交于 2019-12-11 08:33:48
问题 Position of navigation buttons in RTL languages are not correct in iPad Position of navigation button in iPad and iPhone is different when device language is set to Arabic (RTL) Could anyone please guide why this is happening and how to fix this? Thanks in advance for any help provided. Below are the screenshot and details of the device: 1. RTL_iPad_Retina_iOS8.4 (device having incorrect position of buttons) Device: iPad Retina OS: iOS 8.4 2. RTL_iPhone_6sPlus_iOS10.2 Device: iPhone 6s plus

UINavigationBar appearance and Facebook-Sheet Bug

心已入冬 提交于 2019-12-11 08:12:16
问题 I use the following code in my appdelegate: UINavigationBar *navigationBar = [UINavigationBar appearance]; [navigationBar setBackgroundImage:[[UIImage imageNamed:@"top_bar"] stretchableImageWithLeftCapWidth:5 topCapHeight:5] forBarMetrics:UIBarMetricsDefault]; [navigationBar setBackgroundImage:[[UIImage imageNamed:@"top_bar_scape"] stretchableImageWithLeftCapWidth:5 topCapHeight:5] forBarMetrics:UIBarMetricsLandscapePhone]; Everything works fine but i got a weird Bug, when i open the iOS6