uinavigationbar

Failing make Navigation Bar of an UINavigationController display at the bottom programmatically [duplicate]

瘦欲@ 提交于 2019-12-13 05:30:59
问题 This question already has answers here : How to make the Navigation Bar of an UINavigationController display at the bottom? (4 answers) Closed 5 years ago . i am trying to make Navigation Bar of an UINavigationController display at the bottom. Put this in the viewWillApprear, it can work. But it go back to the top when come back via dismiss modal view from other views. Even this will be called again, it just stay on the top. So odd ! CGRect navBarOldCGRect = self.navigationController

Make all instances of UINavigationBar titles lowercase without subclassing?

一曲冷凌霜 提交于 2019-12-13 05:26:21
问题 Some titles in this iOS app are defined in the storyboard. Some of the titles are being set programmatically. Is there a simple way (Obj-C categories maybe?) to make all the titles lowercase without subclassing? 回答1: It is possible with a bit of objective-c magic, using method_exchangeImplementations (AKA "Method Swizzling") #import <objc/runtime.h> @interface UINavigationItem (New) @end @implementation UINavigationItem (New) - (void)setTitleLower:(NSString *)title { [self setTitleLower:

UIBarButton won't show in my UINavigationController

巧了我就是萌 提交于 2019-12-13 04:45:36
问题 I want to make a simple view with a navigation bar and a table view. So I created a subclass of UINavigationController and I added a UITableView in it. My is is also the UITableViewDataSource and UITableViewDelegate . Now I want to add UIBarButton in the navigation bar but it doesn't work : UIBarButtonItem *anotherButton = [[UIBarButtonItem alloc] initWithTitle:[[Translator instance] getTranslation:@"Back"] style:UIBarButtonItemStylePlain target:self.parentViewController action:@selector

How do I return the UIColor of an object in objective c?

守給你的承諾、 提交于 2019-12-13 04:42:10
问题 I'm using XCTest and want to test the navBar of a tableView to see if it is set to a specific colour. How do I reference the colour of the navBar? Kind regards 回答1: For the navigation bar, you likely want navigationBar.barTintColor for the background color. 来源: https://stackoverflow.com/questions/22738090/how-do-i-return-the-uicolor-of-an-object-in-objective-c

ONE controller with TWO navigation bars

£可爱£侵袭症+ 提交于 2019-12-13 04:30:50
问题 I'm using 2 UINavigationController s, all is fine, except that when I return to a previous controller in the other UINavigationController I have its navigation bar + the navigation bar of the previous controller, example: Navigation Controller1 => A controller => B controller => Navigation Controller2=> C controller. When I segue from C controller to A controller I have the navigation bar of both Navigation Controller1 and 2. I tried to make that when I leave C controller: -(void

How to remove navigation bar colour clear in swift4?

可紊 提交于 2019-12-13 04:28:42
问题 I want to clear color of navigation bar. In my ViewController there is a background image on that, when i remove color of navigation barTintColor, navigationController.view.background and navigation background image then simulator shows me :- I have been trying alots of codes but there is no solution found. I want navigation Bar like that:- with clear navigation bar color. Is there any solution, let me know? Thanks! 回答1: You can make the navigation bar transparent in viewWillAppear and remove

add gesture recognizer uivew navigation bar swift not working

℡╲_俬逩灬. 提交于 2019-12-13 04:09:53
问题 I have a navigation controller with a navigation bar, I have added a UIView with subview of imageView and UILabel for titleView. I need to be able to click on that view to do something else with addGestureRecognizer on that view but nothing is printed on the console. The UIImageView has to be next to the UILabel Here is the code I tried so far private func setupNavBarWithUser() { let titleView = UIView() let width = titleView.sizeThatFits(CGSize(width: CGFloat.greatestFiniteMagnitude, height:

Using UINavigationController view

被刻印的时光 ゝ 提交于 2019-12-13 03:57:19
问题 I would like to better understand the use of UINavigationController's. I have setup a new project with a UINavigationViewController, as well as two other view controllers. In my app delegate I have the following: self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. self.window.backgroundColor = [UIColor whiteColor]; firstViewController = [[NCTFirstViewController alloc] initWithNibName:@

Navigation bar title view missing in iOS11

三世轮回 提交于 2019-12-13 03:49:52
问题 I'm working on a project in swift for iPad . Have placed an image view in Navigation bar title view from story board. The title view is displaying as expected in iOS 10 and below. The same project when i run in iOS 11 simulators and the physical devices Navigation bar is not showing the title view , any leads would be appreciated. 回答1: Create a custom view and override below method in the custom title view class to update view frame size at runtime. Obj-C -(CGSize)intrinsicContentSize {

Custom navigationBar on moreNavigationController

故事扮演 提交于 2019-12-13 03:48:58
问题 Hot to customize navigation bar that appear on "More" tab in UITabBarController to have 2 px line (in different color) as bottom border? I created subclass of the UINavigationBar that overrides drawrect: method with drawing of that line, and that works for first four tabs, except tabs that are under more navigation controller. Any help? 回答1: #import <objc/runtime.h> And dynamically set the class of the more view controller's navigation bar: object_setClass(yourTabBarController