Autolayout code implementation example-02-use VFL

Source: Internet
Author: User

Autolayout code implementation example-02-use VFL

0. Introduction: VFL stands for visual format language, which can abstract the layout of one or more views. VFL is simpler than autolayout using linear formulas.

1. Example 1

Requirement: create two views, one in blue and one in red. The distance between blue and the top, left, and right of the screen is 20, make the spacing between the top of the red view and the bottom of the Blue View 20, and the right edge of the two is aligned.

Result: Landscape screen:

 

 

 

2. Example 2

Requirement: create two views, one in blue and one in red. The requirement is that the blue and red views stick to the bottom of the screen forever. The distance between the left and bottom of the Blue View is 20, the width and height of the red view are the same and arranged in the same row.

 

Result: Landscape screen:

 

Autolayout code implementation example-02-use VFL

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.