Some minor notes in iOS small projects (about UIColor color and UIButton circular buttons)

Source: Internet
Author: User

1. When using UIColor

I used the above method and found that there was no effect at all. Later I found that the values of red, green, and blue were all 0 ~ 1. After the attempt, it is found that the following usage is correct: 
Divide each value by 255.0 to get a value ranging from 0 ~ 1. 2. When using UIButton, set the rounded corner as follows: 
In this way, you can set any rounded corner, as long as you can make a circular Button, as long as the frame of this Button is a square, cornerRadius is set to half the length of the square side. 

 

Related Article

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.