user635064
user635064

Reputation: 6247

UIBarButtonItem minus sign

Is there a UIBarButtonSystem icon that is "-" minus? Opposite of this: enter image description here

Thanks.

Upvotes: 2

Views: 1064

Answers (3)

abanet
abanet

Reputation: 1387

I use from the menu Edit -> Emoji & Symbols the EM DASH symbol. It's like a minus but wider. For example:

navigationItem.leftBarButtonItem  = UIBarButtonItem(title: "—", style: .plain, target: self, action: #selector(removeColumn))

The EM DASH symbol

Upvotes: 1

Deepak Danduprolu
Deepak Danduprolu

Reputation: 44633

No, All the available icons are here. You can use a custom view instead.

Upvotes: 2

Jhaliya - Praveen Sharma
Jhaliya - Praveen Sharma

Reputation: 31720

To get minus, you could create an custom button with minus image,

if you look into the below apple documentation for available system UIBar.. buttons

http://developer.apple.com/library/ios/#documentation/uikit/reference/UIBarButtonItem_Class/Reference/Reference.html#//apple_ref/c/tdef/UIBarButtonSystemItem

there is no minus kind of button available So you will have to create by yourself.

Use the below code to create an button with minus image, create UIBarButtonItem by adding your button as custom view,

UIImage *image=[UIImage imageNamed:@"minus.png"];
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
button.bounds = CGRectMake( 0, 0, image.size.width, image.size.height );    
[button setImage:image forState:UIControlStateNormal];
[button addTarget:self action:@selector(Minus) forControlEvents:UIControlEventTouchUpInside];    
UIBarButtonItem *barButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button];
self.navigationItem.rightBarButtonItem = barButtonItem;
[barButtonItem release];

Upvotes: 0

Related Questions