Customize button shape in ios 7.1

Apple has added Button Shape in ios 7.1. But I need to disable it for my application or change its default color to match the user interface of my application. Is this possible without using a custom type button? Please help me.

+5
ios accessibility iphone uibutton
source share
4 answers

Subclass the class and try what shape you want ....

#import "YourButton.h" #import <QuartzCore/QuartzCore.h> @implementation YourButton - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { // Initialization code } return self; } - (void)awakeFromNib { [super awakeFromNib]; CALayer *mask = [CALayer layer]; mask.contents = (id)[[UIImage imageNamed:@"ge.png"] CGImage]; // ge is the black & white png image CGSize size = self.frame.size; mask.frame = CGRectMake(0, 0, size.width, size.height); self.layer.mask = mask; [self.layer setMasksToBounds:YES]; } @end 

For your reference sample attached here.

+3
source share

These functions are reflected in the control buttons by default apples (there may be navigation). You do not need to worry, these functions are not intended for applications, but for all applications.

If you want to ignore, do not use the default button, use the regular one instead.

PS After editing the OP question:

You cannot achieve this without using a custom implementation.

Read more: link

+2
source share

Well, you can make it customizable and use the image according to how you want to view it.

+1
source share

IF you use a UINavigationBar or UIToolbar as a button, then you will get a slightly darker shade color.

Otherwise, you may get underlining which color matches the color of the text, so I think this should not bother you. Leave it as it is.

+1
source share

All Articles