Android UI Layout

Source: Internet
Author: User

First, set the repeating background
Build a Mybackground.xml file in the Drawable folder to write in the file: <?xml version= "1.0" encoding= "Utf-8"? ><bitmap xmlns:android= " Http://schemas.android.com/apk/res/android "android:src=" @drawable/mybg_img "android:tilemode=" repeat "/>

The Tilemode property is the display mode used to define the background:

Disabled default value, which means that tiles are not used

Clamp Copy Edge Color

Repeat X, Y axis Repeat picture display, that is, we say to say tile

Mirror repeating the drawing of a picture in horizontal and vertical directions using alternating mirrors


Second, use layer-list combination picture

Also build a mylayerlist.xml file under the Drawable folder

Write in File:

<?xml version= "1.0" encoding= "Utf-8"?>
<layer-list xmlns:android= "http://schemas.android.com/apk/res/android" >

<item>

<bitmap android:src= "@drawable/sms_top_bg"

android:gravity= "Center"/>

</item>

<item>

<bitmap android:src= "@drawable/sms_list_selected_arrow"

android:gravity= "Right"/>

</item>

</layer-list>

Only pictures can be added to the bitmap, and the file will not be processed (the original picture is displayed). As shown (the layer-list combination is the blue picture plus the small arrow on the right):


You can join <shape></shape> directly in <item></item>

As shown below:

<?xml version= "1.0" encoding= "Utf-8"?>
<layer-list xmlns:android= " http://schemas.android.com/apk/res/android ">

<item>

<shape>

<gradient

Android:startcolor= "#FFFFFF"

Android:endcolor= "#CAFF70"

Android:type= "Linear"

android:angle= "/>"

<padding android:left= "0DP"

android:top= "0DP"

android:right= "0DP"

android:bottom= "0DP"/>

<corners

Android:toprightradius= "6DP"

Android:topleftradius= "6DP"

Android:bottomleftradius= "6DP"

android:bottomrightradius= "6DP"/>

</shape>

</item>

<item>

<bitmap android:src= "@drawable/sms_list_selected_arrow"

android:gravity= "Right"/>

</item>

</layer-list>

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.