uibarbuttonitem

Why doesn't bar button change back to blue? [duplicate]

浪子不回头ぞ 提交于 2019-12-02 03:24:04
问题 This question already has answers here : iOS UINavigationBar button remains faded after segue back (4 answers) Closed last year . I have a '+' button in my main page of my app. It is a UIBarButtonItem . I don't do anything with it in code, only connect it to another view controller in storyboard with segue. The button starts out with its normal blue color. After I dismiss the view controller that was segued to, the bar button item appears gray for some reason. Does anyone know why? Like I

How to add barbutton programmatically with image

匆匆过客 提交于 2019-12-02 03:17:00
I am creating a barbutton programmatically. But it can't fix into screen. Help me in solve this problem. Screenshot: UIImage *image = [UIImage imageNamed:@"request.png"]; UIBarButtonItem *button2; //[button2 setWidth:55]; button2= [[UIBarButtonItem alloc] initWithImage:image style:UIBarStyleDefault target:self action:@selector(requestButton)]; self.navigationItem.rightBarButtonItem = button2; [button2 release]; UIImage *image = [UIImage imageNamed:@"request.png"]; UIButton* requestButton = [UIButton buttonWithType:UIButtonTypeCustom]; [requestButton setImage:image forState:UIControlStateNormal

UIBarbuttonItem change the textColor

岁酱吖の 提交于 2019-12-02 02:53:31
I have these two buttons in a toolBar and wants to change the color of UIBarButtons how can i do such a thing? i've tried setTitleTextAttributes, but it does not seem like it has a object with that? How can i do this UIBarButtonItem *sysDoneButton = [self createButtonWithType:UIBarButtonSystemItemDone target:self action:@selector(actionPickerDone:)]; UIBarButtonItem *sysCancelButton = [self createButtonWithType:UIBarButtonSystemItemCancel target:self action:@selector(actionPickerCancel:)]; A UIBarButtonItem's color is its tintColor . (Or it can use the tintColor inherited from the toolbar you

Change color of UINavigationController back button

倖福魔咒の 提交于 2019-12-02 00:51:53
I'm having problems trying to figure out how to change the color of the buttons on the navigation controller. Previously I had used the following: [[UIBarButtonItem appearance] setTintColor:[UIColor colorWithRed:226/255.0 green:66/255.0 blue:66/255.0 alpha:0.0]]; and this worked, but I added a new view with a toolbar, and the tool bar button images will not show. If I remove the global coloring, the tool bar items show just fine. I've tried setting the tint color on both the leftBarButtonItem and the backBarButtonItem in the viewDidLoad method of the view, but both of those properties appear

how to customize UIBarButtonItem in ios5

梦想的初衷 提交于 2019-12-01 21:54:25
问题 I want customize UIBarButtonItem,here is my code. in ios4.3 it works,but ios5, it‘s very strange. the uibarbuttonitem disappeared out of sight,but you click on it still has the effect。As is transparent。 I need help,how to make the uibarbuttonitem display。thanks UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; btn.frame = CGRectMake(0, 0, 50, 30); [btn setBackgroundImage:[UIImage imageNamed:@"btnRegister.png"] forState:UIControlStateNormal]; [btn setTitle:@"register" forState

how to customize UIBarButtonItem in ios5

♀尐吖头ヾ 提交于 2019-12-01 21:04:36
I want customize UIBarButtonItem,here is my code. in ios4.3 it works,but ios5, it‘s very strange. the uibarbuttonitem disappeared out of sight,but you click on it still has the effect。As is transparent。 I need help,how to make the uibarbuttonitem display。thanks UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; btn.frame = CGRectMake(0, 0, 50, 30); [btn setBackgroundImage:[UIImage imageNamed:@"btnRegister.png"] forState:UIControlStateNormal]; [btn setTitle:@"register" forState:UIControlStateNormal]; [btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; [btn

UIBarButtonItem setTintColor doesn't work on iOS7

对着背影说爱祢 提交于 2019-12-01 20:56:15
In iOS6, I used this code to make my UIBarButtonItem: UIBarButtonItem* validate = [[UIBarButtonItem alloc]initWithTitle:@"MyTitle" style:UIBarButtonItemStylePlain target:self action:@selector(actionValidate)]; [validate setTintColor:[UIColor orangeColor]]; self.navigationItem.rightBarButtonItem = validate; It works fine in iOS6 but in iOS7, the color of the button changes only when you push it.. How can I fix this? null In iOS7 you if you need to change the navigationBar buttons color, you must set tintColor for the navgationBar not the for specific barButton any more. navigationController

Add a back arrow to leftBarButtonItem?

回眸只為那壹抹淺笑 提交于 2019-12-01 17:35:00
I want to add a back arrow to a leftBarButtonItem , to make it appear visually as if it was a regular back button, although it's functionality is slightly different. Is there a way to do this? You can use custom button and hide the back button if you are using navigation controller. To hide back button use this: self.navigationItem.hidesBackButton = YES; And for Custom Button: UIButton * customButton = [UIButton buttonWithType:UIButtonTypeCustom]; [customButton setBackgroundColor:[UIColor colorWithRed:197.0/255.0 green:190.0/255.0 blue:157.0/255.0 alpha:1.0]]; [customButton setTitle:@"Do

Can I use a UIBarButtonSystemItem for a UIButton?

妖精的绣舞 提交于 2019-12-01 17:29:36
I am trying to customize a UIButton and I want to use a UIBarButtonSystemItem style that is available for a UIBarButtonItem object. How do I use a UIBarButtonSystemItem style on a UIBUtton object? You can't. UIBarButton and UIButton are two completely different classes. The best you can do is find images close to what you're looking for and add them to UIButtons. Use a UIView instead of a UIButton that contains a UIToolbar with UIBarButtonItems. UIView *buttonContainer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 80, 44)]; buttonContainer.backgroundColor = [UIColor clearColor]; UIToolbar

Add a back arrow to leftBarButtonItem?

风流意气都作罢 提交于 2019-12-01 17:09:58
问题 I want to add a back arrow to a leftBarButtonItem , to make it appear visually as if it was a regular back button, although it's functionality is slightly different. Is there a way to do this? 回答1: You can use custom button and hide the back button if you are using navigation controller. To hide back button use this: self.navigationItem.hidesBackButton = YES; And for Custom Button: UIButton * customButton = [UIButton buttonWithType:UIButtonTypeCustom]; [customButton setBackgroundColor: