Ios code creation controls and formatting

Source: Internet
Author: User

Ios code creation controls and formatting

1. UIView

The control added to the View is x, and y is calculated from the upper left corner of the View.

2. UIButton

UIButton contains UIlable and UIImageView

SetTitle must be used to set text. titleLabel. text cannot be changed directly because the text status is unknown.

TitleLabel. font when setting the text font

3. NSArray lazy loading

 

 

@ Property (nonatomic, strong) NSArray * apps; @ implementation MJViewController-(void) viewDidLoad {[super viewDidLoad]; // Add application information // 0. total number of columns (a maximum of three columns in a row) int totalColumns = 3; // 1. application size CGFloat appW = 85; CGFloat appH = 90; // 2. gap = (Controller view width-3 * Application width)/4 CGFloat marg.pdf = (self. view. frame. size. width-totalColumns * appW)/(totalColumns + 1); CGFloat marginY = 15; // 3. create a box (index 0 ~ 11) for (int index = 0; index
 
  

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.