uibarbuttonitem

Barbutton item in navigtion bar leftbar button got stick to the top left conrner

醉酒当歌 提交于 2019-12-11 13:53:08
问题 bar button got stick to the y origin as 0 to navigation bar and x as 0.but i want to add some y position to barbutton item. UIBarButtonItem *barbutton; barbutton = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStyleBordered target:self action:@selector(onbackbtnpressed:)]; [barbutton setWidth:30]; [barbutton setTintColor:KANEKA_BLUE_COLOR]; [barbutton setAccessibilityFrame:CGRectMake(10, 10, 30, 20)]; self.navigationItem.leftBarButtonItem = barbutton; Please tell me how

Multiple Barbutton in Navigation Bar not showing on iOS6

为君一笑 提交于 2019-12-11 12:11:22
问题 I have added array of bar button to the navigation items using the property rightBarButtonItems,it work good for iOS5,when i tested in iOS6 only one bar button item is visible. UIBarButtonItem *updateButton = [[UIBarButtonItem alloc] initWithTitle:@"Update" style:UIBarButtonItemStylePlain target:self action:@selector(updateData)]; UIBarButtonItem *refreshButton = [[UIBarButtonItem alloc] initWithTitle:@"Refresh" style:UIBarButtonItemStylePlain target:self action:@selector(refresh)]; NSArray

Setting UIBarButtonItem not changing title, changing only style

拜拜、爱过 提交于 2019-12-11 08:20:05
问题 I have a UIBarButtonItem in the top right which says 'Edit'. When clicked, this code is called - I know so because the button is emboldened. However, the button's title does not change. Here is my code: // set to not editing and change buttons [self setEditing:YES animated:YES]; UIBarButtonItem *doneButton = (UIBarButtonItem *)sender; [doneButton setTitle:@"Done"]; [doneButton setStyle:UIBarButtonItemStyleDone]; self.navigationItem.rightBarButtonItem = doneButton; Edit 2: The following code

Pressing Right Bar Button Item Moves Left Bar Button Items

懵懂的女人 提交于 2019-12-11 07:17:47
问题 I have three left bar button items on my web view nav bar. One that goes back to the the menu of my app and back and forward buttons. I have one right bar button that opens an activity view controller. When I press the right button, the forward and back buttons on the left get moved down and off of the nav bar. - (void)viewDidLoad { leftBarButtonItems = [NSArray arrayWithObjects:@"Menu", @"Back", @"Forward", nil]; [super viewDidLoad]; // Do any additional setup after loading the view from its

custom leftbarbuttonItem not showed in ios 11

送分小仙女□ 提交于 2019-12-11 06:53:44
问题 i had a problem with a custom LeftBarButtonItem when i clicked for the first time it showed the custom leftbarbutton but in the second time it's hidden !!!! this problem appear only in the ios 11 but in ios10 it's worked perfectly. Class A: - (void)setBackButton { if (_backTabBarItem == nil) { UIButton *backButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 30, 30)]; [backButton setImage:[UIImage imageNamed:@"icon_back"] forState:UIControlStateNormal]; [backButton setTitleColor:

Setting action for back button in navigation controller

半城伤御伤魂 提交于 2019-12-11 05:32:22
问题 I'm trying to overwrite the default action of the back button in a navigation controller. I've provided a target an action on the custom button. The odd thing is when assigning it though the backbutton attribute it doesn't pay attention to them and it just pops the current view and goes back to the root: UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithTitle: @"Servers" style:UIBarButtonItemStylePlain target:self action:@selector(home)]; self.navigationItem.backBarButtonItem =

Add the same UIBarButtonItem to several UIViewControllers

青春壹個敷衍的年華 提交于 2019-12-11 05:28:07
问题 I want to add the same UIBarButtonItem to several UIViewController s. I've done this previously by creating a parent UIViewController that manages to add the UIBarButtonItem s in viewDidLoad . But now I have many view controllers that inherit from different view controllers, so if I follow the same strategy I should create a UIViewController subclass for each one of the different view controllers. What I am actually doing is to configure the navigation bar buttons in my BaseViewController ,

UIBarButtonItem's action is not called when in a view with a UIGestureRecognizer

佐手、 提交于 2019-12-11 01:29:21
问题 I have a simple UIViewController derived controller which has UITextFields. Also using IB, I placed a UIToolbar and two UIBarButtonItems. I Ctrl-Drag to add actions to the buttons. - (IBAction)cancel:(id)sender { ... } - (IBAction)save:(id)sender { ... } If I run the code, the actions get called. The problem : I wanted to implement the tap on background to resignFirstResponder paradigm , so I added a UITapGestureRecognizer on the root view: - (void)viewDidLoad { ... UITapGestureRecognizer

IOS Custom UIBarbuttonItem change position in detail view

偶尔善良 提交于 2019-12-11 01:24:49
问题 I'm trying to customize my navigationbar's UIBarbuttonItem so that I'm using this im my Appdelegate.m // didFinishLaunchingWithOptions: { UIImage *navBarImage = [UIImage imageNamed:@"nav-bar.png"]; [[UINavigationBar appearance] setBackgroundImage:navBarImage forBarMetrics:UIBarMetricsDefault]; [[UINavigationBar appearance] setTitleVerticalPositionAdjustment:5 forBarMetrics:UIBarMetricsDefault]; UIImage *barButtonSave = [[UIImage imageNamed:@"nav-bar-button.png"] resizableImageWithCapInsets

UIBarButtonItems not showing up after creating UIToolbar programmatically?

喜夏-厌秋 提交于 2019-12-11 00:32:02
问题 I'm running across this issue which I can't seem to find the answer to online. Basically what I'm trying to do is programmatically create a UIToolbar with some UIBarButtonItems . What I've done (as detailed below) is create the UIToolbar and then set the items of the UIToolbar to an array holding all the UIBarButtonItems I want. Unfortunately, though the UIToolbar shows up, the UIBarButtonItems have yet to show themselves Any suggestions or explanations as to why this is happening is much