uibarbuttonitem

How to do automated UI testing for system button on XCode7?

♀尐吖头ヾ 提交于 2019-11-30 18:10:35
问题 My Storyboard has only one UI, and it has navigation bar with one UIBarButtonItem with System Item: Add. It also has another info UIButton. When doing UI testing in English everything works good without any problem. But if you switch the language to another one, it is always failed. Here is the testing code snippet: app.navigationBars["My Product"].buttons["Add"].tap() app.buttons["More Info"].tap() According to the error log, Xcode find it in another language. Here it is: Assertion Failure:

Hiding UINavigationItem's bar button

大兔子大兔子 提交于 2019-11-30 17:32:53
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. Adrian Avendano This works I tried it myself self.navigationItem.leftBarButtonItem = nil; self.navigationItem.hidesBackButton = YES; I'm pretty sure the only way to "hide" it is to nil it

Adding UIBarButtonItem to UINav..Controller

半腔热情 提交于 2019-11-30 16:23:15
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? - BTW, i do not want to/ will not use IB. UPDATE: Currently this is the closest i can get: -(void

Animating only the image in UIBarButtonItem

心已入冬 提交于 2019-11-30 15:58:06
问题 Ive seen this effect in 2 apps and I REALLY want to find how to do it. The animation is in a UIBarButtonItem, and is only to the image. The image is a + symbol, and it rotates to a X. If you want to see the effect you have to start a conversation with someone and next to the text input theres the + button for images and emoji's. Or heres a video of the effect in another app, after he taps the bar button you see it rotate to a X, http://www.youtube.com/watch?v=S8JW7euuNMo. I have found out how

Issue with button on the left side of the uinavigation bar

孤街浪徒 提交于 2019-11-30 15:42:49
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 setShowsTouchWhenHighlighted:NO]; [leftButton setImage:[UIImage imageNamed:@"deals.png"] forState

Animating only the image in UIBarButtonItem

孤人 提交于 2019-11-30 15:21:27
Ive seen this effect in 2 apps and I REALLY want to find how to do it. The animation is in a UIBarButtonItem, and is only to the image. The image is a + symbol, and it rotates to a X. If you want to see the effect you have to start a conversation with someone and next to the text input theres the + button for images and emoji's. Or heres a video of the effect in another app, after he taps the bar button you see it rotate to a X, http://www.youtube.com/watch?v=S8JW7euuNMo . I have found out how to do the effect but only on a UIImageView, I have to turn off all the autoresizing and the view mode

How to use UIBarButtonSystemItem to change UIBarButtonItem identifier? (Swift)

倾然丶 夕夏残阳落幕 提交于 2019-11-30 15:10:17
问题 I want to change the identifier of an UIBarButtonItem with codes from "Play" to "Pause". How can I do that? Thanks 回答1: 1) init a new button //change to play let button = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Play, target: self, action: "someAction") navigationBar.topItem.leftBarButtonItem = button //change to pause let button = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Pause, target: self, action: "someOtherAction") navigationBar.topItem

How to use UIBarButtonSystemItem to change UIBarButtonItem identifier? (Swift)

一曲冷凌霜 提交于 2019-11-30 13:46:42
I want to change the identifier of an UIBarButtonItem with codes from "Play" to "Pause". How can I do that? Thanks Þorvaldur Rúnarsson 1) init a new button //change to play let button = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Play, target: self, action: "someAction") navigationBar.topItem.leftBarButtonItem = button //change to pause let button = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Pause, target: self, action: "someOtherAction") navigationBar.topItem.leftBarButtonItem = button 2) Just change the text: navigationBar.topItem?.leftBarButtonItem?.title =

Adding UIBarButton item in swift

末鹿安然 提交于 2019-11-30 13:44:31
问题 I'm trying to add a UIBarButton item to my nav bar. Here is my Navigation Bar class declaration: import UIKit class NavigationBarController: UINavigationController { override func viewDidLoad() { super.viewDidLoad() configureToolbar() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } // #pragma mark - Navigation bar data source func configureToolbar() { let toolbarButtonItems = [ searchBarButtonItem ] toolbar

How can I change the font color of a UIBarButton item?

隐身守侯 提交于 2019-11-30 12:35:16
问题 I want to change the color to red. 回答1: This question was answered here. Basically, you have to create a UIButton, configure it as you wish, and then initialize the Bar Button Item with the UIButton as a custom view. 回答2: I found a simpler way to just change the color of title: iOS7: UIBarButtonItem *button = [[UIBarButtonItem alloc] initWithTitle:@"Title" style:UIBarButtonItemStyleBordered target:nil action:nil]; [button setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys: