uinavigationbar

UISearchController doesn't work properly with a non-translucent UINavigationBar

依然范特西╮ 提交于 2019-11-27 03:13:56
问题 Currently I am trying to embed a UISearchController into my application. But the UISearchBar, which is a property of the UISearchController, doesn't get displayed properly, if the UINavigationBar is non-translucent. Usually after tapping the UISearchBar property, the UINavigationBar moves up to make room for the UISearchBar. You can see the result on the following screenshot: https://www.dropbox.com/s/172k63zr2bhj84t/Normal_behaviour.png?dl=0 But if the "translucent" property of the

How can I set the UINavigationbar with gradient color?

时光总嘲笑我的痴心妄想 提交于 2019-11-27 03:13:25
I want to set the UINavigationbar backgroundColor to a gradient color where I would like to set it via an array of colors to create a Gradient, ideally, as accessible methods inside UINavigationBar to change its color to this gradient. Any suggestions? (Aside from setting an image manually as the background image of the navigation bar) Create gradient layer and add it as background of navigation bar. CAGradientLayer *gradient = [CAGradientLayer layer]; gradient.frame = self.navigationController.navigationBar.bounds; gradient.colors = [NSArray arrayWithObjects:(id)[[UIColor whiteColor] CGColor]

How to subclass UINavigationBar for a UINavigationController programmatically?

£可爱£侵袭症+ 提交于 2019-11-27 03:04:15
I'm using a custom drawRect function to draw on UINavigationBar across my application in iOS4, it doesn't use images, only CoreGraphics. Since you can't implement drawRect in UINavigationBar category in iOS5, Apple is suggesting to subclass UINavigationBar . How is it possible to replace the UINavigationBar with my subclass in UINavigationController (so it'll be compatible with iOS4 and iOS5) when the navigationBar property is read only? @property(nonatomic, readonly) UINavigationBar *navigationBar I'm not using XIBs in my application at all, so adding a UINavigationBar to a NIB and changing

Swift programmatically navigate to another view controller/scene

谁说胖子不能爱 提交于 2019-11-27 02:52:26
I'm using following code to programmatically navigate to another ViewController. It works fine, but it some how hides the navigation bar . How do I fix this? (the navigation bar is created by embeding the ViewController in the navigation controller if that matters.) let storyBoard : UIStoryboard = UIStoryboard(name: "Main", bundle:nil) let nextViewController = storyBoard.instantiateViewControllerWithIdentifier("nextView") as NextViewController self.presentViewController(nextViewController, animated:true, completion:nil) In Swift 3 With a programmatically created Controller If you want to

Draw custom Back button on iPhone Navigation Bar

ε祈祈猫儿з 提交于 2019-11-27 02:48:17
问题 I've got a UIView with a NavigationBar and I'd like to add a button which looks like the style of a Back Button. I'm not using a UINavigationController and was wondering if this could be done without it? The style of the button should look like this: Thanks 回答1: You need to set up a custom stack of UINavigationItem objects and push them on to the UINavigationBar. This is the only way I know of to get a true back button. I haven't tested this code, but you should do something like this:

iOS 7 | Navigation bar / Toolbar buttons very close to status bar

一个人想着一个人 提交于 2019-11-27 02:46:14
I have a problem when dragging a navigation bar or toolbar (storyboard) to my view controller. UINavigationBar: As you can see in the image above, the right button is almost overlapping the status bar. With a UIToolbar it happens the same: This view controllers are intended to be used as a Modal, that's the reason I'm not using a UINavigationController. In another section I use a UINavigationController and it appears as I expect: How can I drag a UINavigationBar / UIToolbar to a view controller without overlapping the status bar? The navigation bars or toolbars have to be at (0, viewController

Changing navigation title programmatically

﹥>﹥吖頭↗ 提交于 2019-11-27 02:44:03
I have a navigation bar with a title. When I double click the text to rename it, it actually says it's a navigation item, so it might be that. I'm trying to change the text using code, like: declare navigation bar as navagationbar here button stuff { navigationbar.text = "title" } That's not my code obviously, just showing how it would work. So whenever I press the button, I want the title to change. You change the title by changing the title of the view controller being displayed: viewController.title = "some title" Normally this is done in view did load on the view controller: override func

iOS 11 customise search bar in navigation bar

纵饮孤独 提交于 2019-11-27 02:40:25
I want to change the color of the text and icon in the iOS 11 searchbar when it is embedded in the navigation bar. So placeholder text, search text and search icon. if #available(iOS 11.0, *) { navigationController?.navigationBar.prefersLargeTitles = false let searchController = UISearchController(searchResultsController: nil) navigationItem.searchController = searchController navigationItem.hidesSearchBarWhenScrolling = false searchController.searchBar.placeholder = "Suchen" searchController.searchBar.tintColor = .white } As you can see in the image, the text is grey on a deep blue background

Add a UIView above all, even the navigation bar

我只是一个虾纸丫 提交于 2019-11-27 02:35:40
I want to display, above any other views, even the navigation bar, a kind of "pop-up" view that looks like this: full screen black background with a 0.5 alpha to see the other UIViewController underneath. a UIView window in the middle with some information, (a calendar if you want to know everything). To do that, I've created a UIViewController that contains the two UIViews (background and window), and I'm trying to display it. I've tried a simple [mySuperVC addSubview:myPopUpVC.view] , but I still have the navigation bar above. I've tried to present it as a modal, but the UIViewController

iOS 7 UINavigationController NavBar per controller color animation

ⅰ亾dé卋堺 提交于 2019-11-27 02:25:24
问题 Is there any way to have different barTintColor of UINavigationController 's UINavigationBar on different pushed controllers with smooth color transition animation ? I'd like to have a smooth animation of UINavigationBar 's tint color during UINavigationController 's push/pop animation and ideally also interactive pop (gesture based controller pop). Why do I need this? I'd like to have 1 controller in the navigation stack to have different tint color indicating status of some task (red /