uinavigationitem

Crasher in a custom view as UINavigationControllers navigationItem.titleView

淺唱寂寞╮ 提交于 2019-12-11 15:13:13
问题 I have an UIViewController with several subviews in its view property ( UISearchbar and several UIButton s). The UIButton s hooked up to typical IBAction s like -(IBAction)buttonPressed:(id)sender for the UIControlEventTouchUpInside state - it doesn't matter if I do it in IB or programmatically. - (void)viewDidLoad { MUZTitleViewController *title = [[MUZTitleViewController alloc] initWithNibName:nil bundle:nil]; self.navigationItem.titleView = title.view; } In my project there's also an

Handle popViewControllerAnimated like event in another class?

痞子三分冷 提交于 2019-12-11 14:25:57
问题 I have to create a same button in every ViewController. So i decided to write a class having this functionality once. I have created a class name MyUtils and added a back button to UINavigationItem and it displays correctly but don't know how to add an event to it in that class. It displays accurately but no event is perform. I mean popViewControllerAnimated:YES I call myUtil like MyUtil *utils = [[MyUtil alloc] init]; [utils NavAndBackBtn:self.navigationItem]; MyUtil.m -(void)NavAndBackBtn:

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

How to change background image for navigation item(button)?

北慕城南 提交于 2019-12-11 08:57:45
问题 I want to set background image for every navigation item(button) (universal). How should these images look? Are there fixed dimensions or it is possible to create repeating background image? How to programmatically change then this background image? Thank's for help UPDATE: I found this code for changing background of this button but it's no working. UIImage *barButton = [UIImage imageNamed:@"button_background.png"]; [[UIBarButtonItem appearance] setBackgroundImage:barButton forState

Prepareforsegue navigationItem.title one behind

南笙酒味 提交于 2019-12-11 04:59:54
问题 I'm still relative new to object c, so please bear over with me if this is a rookie question. I'm trying to set the title of my navigationcontroller with the corresponding object information. I'm using prepareforsegue for it, but the first time is segue to the new controller, the title is blank. If i try again, it shows up, but if i pressed something else, it shows the title of the things i pressed the time before. I have embedded my code below. //.h #import <UIKit/UIKit.h> @interface

Change width/height UINavigationBar embedded in a Navigation Controller?

拥有回忆 提交于 2019-12-11 04:50:20
问题 Constraints can be assigned to UINavigationBar that is added manually to the view. But when the UINavigationBar is added to a view when and the view is embedded in a Navigation Controller, I am not able to add constraints to the same. My objective is to increase the height of the UINavigationBar 回答1: UINavigationBar does not allow to assign constraints to itself. The only easy way that the height can be changed is by adding a space to the prompt property. To increase the the height of the

navigationItem button not showing

馋奶兔 提交于 2019-12-11 04:14:42
问题 I have a UINavigationItem i am trying to show a UIBarButtonItem . Now the problem is i added them correctly, they're functional and working 100%. but they're not showing on the UINavigationBar . Now for the flow I am doing the following. 1- I am hiding the back button, like this self.navigationItem.setHidesBackButton(isBackHidden, animated: false) 2- I am adding those 2 buttons using a function dynamically at run time, when a user tap on a UIButton . let rightBarItem = UIBarButtonItem(title:

Adding UIImage ignores and resizes UIImageView frame

前提是你 提交于 2019-12-11 02:33:41
问题 I'm currently trying to add an image into the navigation item for one view. In the view's viewDidLoad() , a function is called with the following code, similar to this post: let logo = UIImage(named: "Menu_Logo") let imageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 122, height: 26)) imageView.contentMode = .scaleAspectFit imageView.clipsToBounds = true imageView.image = logo self.navigationItem.titleView = imageView Instead of giving me the expected size however, the view ends up

UIBarButtonItem Title Text is Always Global Tint Color

醉酒当歌 提交于 2019-12-10 22:41:10
问题 iOS 7.0 and up. In AppDelegate.m, I'm setting my global tintColor: self.window.tintColor = myGlobalTintColor; . In my table view controller where I want a red trash can button in the navigation bar while editing the table view cells, I have this: - (void)setEditing:(BOOL)editing animated:(BOOL)animate { [super setEditing:editing animated:animate]; if (editing) { // Start editing self.deleteBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemTrash target

How do I manually set the “Back” destination in iOS apps

佐手、 提交于 2019-12-10 20:47:16
问题 I have a UIViewController called 'detailViewController'. This view controller is accessed through multiple different segues using the push segue. The problem I am facing is that the back button on the detailViewController takes the user back to the previous view controller (as it should), however I would like the back button to take the user to the masterViewController (the default UIViewController in the app). How do I do this? I have tried changing the segue types however that didn't really