Xamarin Learning page Layouts

Source: Internet
Author: User

In Android, there are 3 files that need to be noted: Main.axml,string.xml and Activity.cs.

1. layout file Main.axml, this file is saved in the Resouses/layout directory, which is also a directory where all layout files are used.

2. variable file String.xml

Some common common variables are saved in the file, and the corresponding values are assigned to those variables. These values are often strings and are used to display in some controls.

3. Logic implementation file Activity.cs

One: Linear layout linearlayout

Common Properties:

Control layout Property Value Note
Vertical layout
LinearLayout Orientation Vertical Indicates that the linear layout method is vertical
Layout_width Fiil_parent Populating the parent container
Layout_height Fill_parent Populating the parent container
Background #FFFFFF The layout background is white
Horizontal layout
LinearLayout Orientation Horizontal Layout as horizontal line layout

Second: relative layout relativelayout

The relative layout is used in two ways, one relative to the parent container's layout, and one for the relative layout of the controls.

A. Layout relative to the parent container

When using this layout, you need to use a key 8 properties for the layout, as follows:

Layout_marigntop: The distance from the top edge of the parent container to the topmost part of the control.

Layout_mariginbutton: The distance at the bottom of the control from the bottom of the parent container.

Layout_mariginright: Distance from the right edge of the parent container to the right of the control.

Layout_mariginleft: Distance from the left edge of the parent container to the left of the control.

Layout_alignparettop: The control is aligned with the top of the parent container, but first, the Layout_margintop value must be met.

Xamarin Learning page Layouts

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.