rightbarbuttonitem

rightBarButtonItem info button, no space to the right

匆匆过客 提交于 2019-12-03 07:40:03
问题 I have a UIViewController set up to display an info-button on the right in its UINavigationItem like this: UIButton *infoButton = [UIButton buttonWithType:UIButtonTypeInfoLight]; [infoButton addTarget:self action:@selector(toggleAboutView) forControlEvents:UIControlEventTouchUpInside]; self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithCustomView:infoButton] autorelease]; That works perfectly, but the only problem is that I'm left with little to no space to the right

rightBarButtonItem info button, no space to the right

旧城冷巷雨未停 提交于 2019-12-02 22:39:28
I have a UIViewController set up to display an info-button on the right in its UINavigationItem like this: UIButton *infoButton = [UIButton buttonWithType:UIButtonTypeInfoLight]; [infoButton addTarget:self action:@selector(toggleAboutView) forControlEvents:UIControlEventTouchUpInside]; self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithCustomView:infoButton] autorelease]; That works perfectly, but the only problem is that I'm left with little to no space to the right of the button, which looks pretty ugly: Is there any way for the button to move about 5 px out from the

Customizing self.editButtonItem with Check and UnCheck- HELP

余生长醉 提交于 2019-12-02 19:44:28
问题 So with regards to the rightBarButtonItem . I have self.navigationItem.rightBarButtonItem = self.editButtonItem; When I press Edit, I get animation and a vertical stripe on the left side of each TableViewCell. When I click that stripe, the Delete button appears on the right side of THAT tableViewCell. I want to do two things. Rename that 'Delete' to 'Check' If it is checked, it should display 'Uncheck' to be tapped. I would appreciate any help on that.. :) 回答1: Implement tableView

Customizing self.editButtonItem with Check and UnCheck- HELP

早过忘川 提交于 2019-12-02 13:13:33
So with regards to the rightBarButtonItem . I have self.navigationItem.rightBarButtonItem = self.editButtonItem; When I press Edit, I get animation and a vertical stripe on the left side of each TableViewCell. When I click that stripe, the Delete button appears on the right side of THAT tableViewCell. I want to do two things. Rename that 'Delete' to 'Check' If it is checked, it should display 'Uncheck' to be tapped. I would appreciate any help on that.. :) Implement tableView:titleForDeleteConfirmationButtonForRowAtIndexPath: in your table view delegate. For the second part of the answer I did

How to hide share button in QLPreviewController using swift?

走远了吗. 提交于 2019-12-01 08:11:30
I'm using the below code to use QLPreviewcontroller to show some documents in my app, let ql = QLPreviewController() ql.dataSource = self //ql.navigationItem.rightBarButtonItems = nil ql.navigationItem.rightBarButtonItem = nil presentViewController(ql, animated: true, completion: nil) I don't want the share button in the right top of QLPreviewcontroller. I'd tried setting rightBarButtonItem to nil, but it's not working. How can I hide that? None of those solutions worked for me in Swift 3 for iOS 10 . The issue is that the Share button is created after viewDidAppear method. Here are the steps

How to adjust space between two UIBarButtonItem in rightBarButtonItems

≯℡__Kan透↙ 提交于 2019-11-28 06:46:19
I am using the following codes to add two button to self.navigationItem.rightBarButtonItems, and I think in iOS7, the space between two buttons are too wide, is there a way to decrease the space between these two buttons? UIBarButtonItem *saveStyleButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"save.png"] style:UIBarButtonItemStyleBordered target:self action:@selector(saveStyle)]; UIBarButtonItem *shareStyleButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(shareStyle)]; NSArray *arr= [[NSArray alloc]

How do I hide/show the right button in the Navigation Bar

做~自己de王妃 提交于 2019-11-28 03:56:22
I need to hide the right button in the Navigation Bar, then unhide it after the user selects some options. Unfortunately, the following doesn't work: NO GOOD: self.navigationItem.rightBarButtonItem.hidden = YES; // FOO CODE Is there a way? Hide the button by setting the reference to nil, however if you want to restore it later, you'll need to hang onto a copy of it so you can reassign it. UIBarButtonItem *oldButton = self.navigationItem.rightBarButtonItem; [oldButton retain]; self.navigationItem.rightBarButtonItem = nil; //... later self.navigationItem.rightBarButtonItem = oldButton;

How do I hide/show the right button in the Navigation Bar

末鹿安然 提交于 2019-11-27 05:14:59
问题 I need to hide the right button in the Navigation Bar, then unhide it after the user selects some options. Unfortunately, the following doesn't work: NO GOOD: self.navigationItem.rightBarButtonItem.hidden = YES; // FOO CODE Is there a way? 回答1: Hide the button by setting the reference to nil, however if you want to restore it later, you'll need to hang onto a copy of it so you can reassign it. UIBarButtonItem *oldButton = self.navigationItem.rightBarButtonItem; [oldButton retain]; self

How to adjust space between two UIBarButtonItem in rightBarButtonItems

元气小坏坏 提交于 2019-11-27 01:35:56
问题 I am using the following codes to add two button to self.navigationItem.rightBarButtonItems, and I think in iOS7, the space between two buttons are too wide, is there a way to decrease the space between these two buttons? UIBarButtonItem *saveStyleButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"save.png"] style:UIBarButtonItemStyleBordered target:self action:@selector(saveStyle)]; UIBarButtonItem *shareStyleButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem