1. Many people know that it is common to set a button to the other uiview of the sub-class, you need to use the following statement
<span style= "FONT-FAMILY:SIMSUN;FONT-SIZE:18PX;" >self.button.layer.cornerradius=10;//</span>
<span style= "FONT-FAMILY:SIMSUN;FONT-SIZE:18PX;" ></span>
Note: This is implemented with the properties of the layer layers, because in a uiview subclass,
UIView itself is only used to listen to events, and the real content is the layer layers, which of course also contains the implementation of animation, such as we do to a view animation
is actually the animation of the layer;
2. However, there are always curious people who want to know how to pass, Storyboard/xib set a button or UIView fillet:
Through my research, I found a powerful way to set properties that Storybord cannot add, such as rounded corners, or borders
This method is runtime attribute runtime properties, that is, at run time you set this property will work, which embodies the OC language dynamic characteristics and runtime (runtime) of the powerful
Create a button and then set the constraint (so that the button "disappears"), such as, and then select the button to select the right inspector
For example, click on the + sign to add a button-related property, which can be a property that is not on the storyboard, this method is similar to the effect of the code, each property has a corresponding value (object),
If the number corresponds to a value type of nsnumber, such as, fill in the runtime Attrite in the property name do not write wrong, otherwise the runtime will crash
Finally, you can see the rounded corners you want on the simulator.
3. Similar you can add other properties of the button
iOS development Storyboard Set rounded buttons