How to add clipping and shading to Btn/lab/view,--storyboary under iOS development

Source: Internet
Author: User

Tag: Runtime Color Run does not have time digital logs technology sharing object

In the development process, many times we need to customize the properties of a control, such as borders, shadows, fillet clipping, and so on, when using code to create a control, we all know, directly to the layer layers of various properties of the operation,

self.button.layer.cornerradius=;

However, in the Storyboard/xib drag control, how to pass, Storyboard/xib set a button or UIView fillet, you can set the Storybord cannot add properties, such as rounded corners, or borders, this method is runtime The attribute runtime property, which is what you set at run time, will work, reflecting the dynamic nature of the OC language and the Power of runtime (runtime).

Words not much to say, direct:

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 name of the property should not be written wrong, or the runtime will crash.

Then you can see the clipping effect of the fillet on the simulator, and the similar attributes can be added as well!

How to add clipping and shading to Btn/lab/view,--storyboary under iOS development

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.