Android Grid Layout GridLayout

Source: Internet
Author: User

Tablelayout (Grid layout)

To be aware of:

Grid layout requires minimum version support:
API 14 is also the lowest andriod4.0

:layout/activity_main.xml

<linearlayout xmlns:android= "Http://schemas.android.com/apk/res/android"
Android:layout_width= "Match_parent"
android:layout_height= "Match_parent"
android:orientation= "Vertical" >
<gridlayout android:layout_width= "Match_parent"
android:layout_height= "Wrap_content"
Android:columncount= "5"
android:orientation= "Horizontal" >
<textview android:text= "User name"/>
<edittext android:hint= "Please enter 1-10 characters"
Android:layout_columnspan= "4"
Android:layout_gravity= "Fill_horizontal"
/>
<textview android:text= "Password"/>
<edittext android:hint= "Please enter 1-10 characters"
Android:layout_columnspan= "4"
Android:layout_gravity= "Fill_horizontal"
/>
</GridLayout>
<gridlayout android:layout_width= "Match_parent"
android:layout_height= "Wrap_content"
Android:columncount= "5"
android:orientation= "Horizontal" >
<button android:text= "No"
android:visibility= "Invisible"/>
<button android:text= "Login"
android:drawableleft= "@drawable/login32x32"
android:background= "@drawable/BTN_BG"
Android:textcolor= "#FFF"/>

<button android:text= "No"
android:visibility= "Invisible"
/>
<button android:text= "Exit"
android:drawableleft= "@drawable/exit32x32"
android:background= "@drawable/BTN_BG"
Android:textcolor= "#FFF"/>
<button android:text= "No"
android:visibility= "Invisible"/>
</GridLayout>


</LinearLayout>

Effect:

650) this.width=650; "src=" http://img.blog.csdn.net/20141116195038512 "/>

This article from "Follow the heart of the other side" blog, declined reprint!

Android Grid Layout GridLayout

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.