Android instance-Mobile security Defender (vi)-Make ribbon (Set Center) UI interface

Source: Internet
Author: User

First, the goal.

Make a similar effect in your phone settings.

Second, the code implementation.

1, the overall use of linear layout, the top is a textview, the following a relative layout, and set the relative layout of the offset with the edge.

2. There are 4 components in the relative layout: 2 TextView, 1 checkboxes, and 1 straight lines.

3, the line of drawing: The <View.../> control, set the height of "0.1dip" (the size of the value determines the thickness of the line), the background color is black (background color is the color of the line), other properties such as width and other space as normal settings.

The code is as follows:

1<?xml version= "1.0" encoding= "Utf-8"?>2<linearlayout xmlns:android= "Http://schemas.android.com/apk/res/android"3Android:layout_width= "Match_parent"4android:layout_height= "Match_parent"5android:orientation= "Vertical" >6 7<TextView8Android:layout_width= "Match_parent"9android:layout_height= "50dip"TenAndroid:background= "#00ffff" Oneandroid:gravity= "Center" Aandroid:text= "Setting Center" -Android:textcolor= "#000000" -Android:textsize= "26sp"/> the  -<Relativelayout -Android:layout_width= "Wrap_content" -android:layout_height= "Wrap_content" +android:layout_marginleft= "10dip" -android:layout_marginright= "10dip" > +  A<TextView atAndroid:id= "@+id/setting_update_title" -Android:layout_width= "Wrap_content" -android:layout_height= "Wrap_content" -android:layout_margintop= "10dip" -android:text= "Automatic Updates" -Android:textcolor= "#000000" inAndroid:textsize= "22dip"/> -  to<TextView +Android:id= "@+id/setting_update_content" -Android:layout_width= "Wrap_content" theandroid:layout_height= "Wrap_content" *android:layout_below= "@id/setting_update_title" $Android:text= "Allow Automatic Updates when software is networked"Panax NotoginsengAndroid:textcolor= "#88000000" -Android:textsize= "18dip"/> the  +<CheckBox AAndroid:id= "@+id/setting_update_checkbox" theAndroid:layout_width= "Wrap_content" +android:layout_height= "Wrap_content" -Android:layout_alignparentright= "true" $Android:layout_centervertical= "true"/> $<View -android:layout_below= "@id/setting_update_content" -Android:layout_width= "Match_parent" theandroid:layout_height= "0.1dip" -android:layout_margintop= "2dip"Wuyiandroid:background= "#70000000"/> the          -</RelativeLayout> Wu  -</LinearLayout>
View Code

Android instance-Mobile security Defender (vi)-Make ribbon (Set Center) UI interface

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.