uibarbuttonitem

UINavigationBar with two buttons on the left

∥☆過路亽.° 提交于 2019-12-19 10:09:00
问题 I know that on stackoverflow there are many similar questions but mine is a little different. I'll show this with images, because it's easier to understand. Using this code I took from here, I had this result: It's easy to see that the second button isn't all on the screen. I tried to but negative numbers in the UIToolbar frame but they don't work. I don't need any title there, only a way to move these buttons to the left. 回答1: Here is a different approach. I created a custom segmented

Hiding UINavigationItem's bar button

别说谁变了你拦得住时间么 提交于 2019-12-18 19:01:18
问题 I have added a BarButton item to the left of the nav.bar through Interface Builder and in the code I want this only to show in my table view's edit mode. But I didn't find any hidden property to set the leftBarButtonItem (like: self.navigationItem.leftBarButtonItem.hidden = YES ). I can only set enabled property. Anybody know how to control the hide and show property of the leftBarButtonItem , please help. 回答1: This works I tried it myself self.navigationItem.leftBarButtonItem = nil; self

Adding UIBarButtonItem to UINav..Controller

℡╲_俬逩灬. 提交于 2019-12-18 18:10:11
问题 i am not sure what i am missing here. I Have a custom UINavigationController and i am trying to add a persistant UIBarButtonItem to the bar. -(void)viewDidLoad { self.navigationBar.barStyle = UIBarStyleBlack; UIBarButtonItem *bbi = [[UIBarButtonItem alloc] initWithTitle:@"Nope..." style:UIBarButtonItemStyleBordered target:self action:@selector(goBack:)]; self.navigationItem.leftBarButtonItem =bbi; [bbi release]; } -(void)goBack:(id)sender { NSLog(@"go back now"); } what am i missing here? -

Issue with button on the left side of the uinavigation bar

社会主义新天地 提交于 2019-12-18 17:30:39
问题 I have a button on the left side of the navigation bar. I also have a UIButton near that button. Now when I click the button thats below the navigation bar, in many cases, the button on the nab bar gets clicked. Any idea why this is happening? Any suggestions ? Thanks. image: if you click anywhere inside the red button, the top left button of the nav bar still gets pressed. code for nav bar button: UIButton *leftButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 25, 25)]; [leftButton

Custom background for UINavigationBar problems

有些话、适合烂在心里 提交于 2019-12-18 12:03:40
问题 I've managed to add a custom background to my navigation bar by using: UIImageView *iv = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"UINavigationBar.png"]]; [myViewController.navigationBar insertSubview:iv atIndex:0]; [iv release]; This works fine and I can see the title and buttons okay. However, when I drill down one level and then go back to the root, the buttons are hidden, but the title is still visible. It appears the navigation bar image is covering the button items. I'm

“Plain Style unsupported in a Navigation Item” warning with my customized Bar Button Item

孤者浪人 提交于 2019-12-18 10:44:16
问题 I drag a Round Rect Button to the position of the right Bar Button Item, and set an image to the Round Rect Button. All works well, except the warning "Plain Style unsupported in a Navigation Item". Even if i select the style of the Bar Button Item to "Bordered", warning still be there. What's the matter with Xcode 4.2? Thanks in advance! Ps. I customized many Bar Button Items with Round Rect Button, some times Xcode 4.2 shows only one warning on a Bar Button Item, some times shows warnings

how to programmatically set action for barButtonItem in swift 3?

我怕爱的太早我们不能终老 提交于 2019-12-18 10:26:41
问题 Here is what I used previously, var barButtonItem = UIBarButtonItem(image: backImgs, style: UIBarButtonItemStyle.plain, target: self, action: Selector("menuButtonTapped:")) But there is some syntax changes for Swift 3. 回答1: ex:- navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Add", style: .plain, target: self, action: #selector(addTapped)) 回答2: Summarize the mostly used method in Swift 3 for adding action to a barButton. Barbutton with text navigationItem.rightBarButtonItem =

How can I set two buttons on the right side of an UINavigationBar?

我只是一个虾纸丫 提交于 2019-12-18 09:39:49
问题 I have made a standard Master-Detail application (with the Xcode template). I modified it, and now when I click one cell of the first table view the app shows another table view (which is the detail because is filtered by the clicked cell value). In a standard table view I would have this situation on the UINavigationBar: Edit Table title + (for adding new items) I need the default back button of UINavigationBar too. Is it possible and allowed to do this? Graphically it would be like this: <

iOS: Append FontAwesome icon with title in UIBarButtonItem and Button

安稳与你 提交于 2019-12-18 08:52:54
问题 I want a UIBarButton Item like this in my NavigationBar and Normal UIButton like this I already tried using these links Question 1 Question 2 Question 3 but didn't got the output. My need is to append that FontAwesome icon with the button title text. Can anyone help in this? My code is: NSString *icon = [NSString fontAwesomeIconStringForIconIdentifier:@"fa-folder-open"]; NSString *locationString = [NSString stringWithFormat:@"%@ %@", icon, @"Change"]; NSMutableAttributedString *astring = [

iOS: Append FontAwesome icon with title in UIBarButtonItem and Button

别说谁变了你拦得住时间么 提交于 2019-12-18 08:51:48
问题 I want a UIBarButton Item like this in my NavigationBar and Normal UIButton like this I already tried using these links Question 1 Question 2 Question 3 but didn't got the output. My need is to append that FontAwesome icon with the button title text. Can anyone help in this? My code is: NSString *icon = [NSString fontAwesomeIconStringForIconIdentifier:@"fa-folder-open"]; NSString *locationString = [NSString stringWithFormat:@"%@ %@", icon, @"Change"]; NSMutableAttributedString *astring = [