Android style and theme (i)

Source: Internet
Author: User

The "Android registration page" blog in the Main.xml code in each component defines the attributes have a duplicate of the section, in order to avoid the tedious can be the various components duplicate properties defined into a file: res/values/
Style_test.xml Source:

<?xml version= "1.0" encoding= "Utf-8"?>
<resources>
<style name= "Codefont" parent= "@android: Style/textappearance.medium" >
<item name= "Android:layout_width" >match_parent</item>
<item name= "Android:layout_height" >wrap_content</item>
<item name= "Android:textsize" >16sp</item>
</style>
</resources>

The Main.xml file is modified as follows:

<?xml version= "1.0" encoding= "Utf-8"?>
<tablelayout xmlns:android= "Http://schemas.android.com/apk/res/android"
Android:layout_width= "Match_parent"
android:layout_height= "Match_parent"
android:stretchcolumns= "1"
android:background= "@drawable/bluesky"
>

<!--account--
<TableRow>
<textview
style= "@style/codefont"
android:text= "Account Number:"
/>
<edittext
style= "@style/codefont"
android:hint= "Phone Number"
Android:selectallonfocus= "true"
/>
</TableRow>

<!--password--
<TableRow>
<textview
style= "@style/codefont"
android:text= "Password:"
/>
<edittext
style= "@style/codefont"
Android:inputtype= "Numberpassword"
/>
</TableRow>

<!--Birthday--
<TableRow>
<textview
style= "@style/codefont"
android:text= "Birthday:"
/>
<edittext
style= "@style/codefont"
Android:inputtype= "Date"
/>
</TableRow>

<!--address--
<TableRow>
<textview
style= "@style/codefont"
android:text= "Address:"
/>
<edittext
style= "@style/codefont"
Android:inputtype= "Textpostaladdress"
/>
</TableRow>

<!--e-mail--
<TableRow>
<textview
style= "@style/codefont"
android:text= "e-mail:"
/>
<edittext
style= "@style/codefont"
Android:inputtype= "Textemailaddress"
/>
</TableRow>

<!--Registration--
<TableRow>
<button
style= "@style/codefont"
android:text= "Register"
/>
</TableRow>

</TableLayout>

The running result is still.

Android style and theme (i)

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.