For example, the round button, ios7 are used in several places, how to do? Whether the system provides a default style, word on the class can do. For example: UIButton * btn1 = [UIButton buttonWithType: UIButtonTypeSystem]; Seeking advice, thank you Reply: You make it a UI prototype picture on it.
UIButton * btn = [UIButton buttonWithType: UIButtonTypeRoundedRect]; UIImage * bgimg = [UIImage imageNamed: @ "bgimg"]; btn.frame = CGRectMake (30, (0,0, bgimg.size.width, bgimg.size.height); [Btn setBackgroundImage: bgimg forState: UIControlStateNormal]; [Btn addTarget: self action: @ selector (tagrt :) forControlEvents: UIControlEventTouchUpInside]; [Self.view addSubview: btn]; Reply: You can customize a CircleButton it directly or indirectly inherits from UIButton In this custom class, override the - (void) drawRect: (CGRect) rect or awakeFromNib to handle also. Reply:
I just to ask, is there a system like the style, if the system does not provide further customization. Reply:
That was to be their own definition, I think the system will provide the style and the like. Reply:
You can customize a CircleButton it directly or indirectly inherits from UIButton In this custom class, override the - (void) drawRect: (CGRect) rect or awakeFromNib to handle also.
That was to be their own definition, I think the system will provide the style and the like.
No comments:
Post a Comment