Use of stretchcolumns in tablelayout

Source: Internet
Author: User
<? XML version = "1.0" encoding = "UTF-8"?>

<Tablelayout xmlns: Android = "http://schemas.android.com/apk/res/android"

Android: layout_width = "fill_parent"

Android: layout_height = "fill_parent"
Android: stretchcolumns = "1">

<! --
Android: stretchcolumns = "1" is the second column for setting all columns of tablelayout.

That is to say, if each row has three columns, the remaining space will be filled by the second column.
-->
<Tablerow>

<! -- Enter from the second column -->
<Textview

Android: layout_column = "1"
Android: text = "open ..."

Android: padding = "3dip"/>
<! -- The size of the blank edge from the character circle to the textview
-->
<! -- Set the method for setting the characters in textview. This is the difference between the right alignment and layout_gravity. -->

<Textview
Android: text = "Ctrl-o"

Android: gravity = "right"
Android: padding = "3dip"/>

</Tablerow>

<Tablerow>
<Textview

Android: layout_column = "1"
Android: text = "Save ..."

Android: padding = "3dip"/>
<Textview

Android: text = "Ctrl-s"
Android: gravity = "right"

Android: padding = "3dip"/>
</Tablerow>

<Tablerow>
<Textview

Android: layout_column = "1"
Android: text = "Save ..."

Android: padding = "3dip"/>
<Textview

Android: text = "Ctrl-shift-s"

Android: gravity = "right"
Android: padding = "3dip"/>

</Tablerow>

<! -- The height of a split line is 2, which is the parent color of textview. -->

<View
Android: layout_height = "2dip"

Android: Background = "# ff909090"/>

<Tablerow>

<Textview
Android: text = "X"

Android: padding = "3dip"/>
<Textview

Android: text = "import ..."
Android: padding = "3dip"/>

</Tablerow>

<Tablerow>
<Textview

Android: text = "X"
Android: padding = "3dip"/>

<Textview
Android: text = "Export ..."

Android: padding = "3dip"/>
<Textview

Android: text = "Ctrl-e"
Android: gravity = "right"

Android: padding = "3dip"/>
</Tablerow>

<View
Android: layout_height = "2dip"

Android: Background = "# ff909090"/>

<Tablerow>

<Textview
Android: layout_column = "1"

Android: text = "quit"
Android: padding = "3dip"/>

</Tablerow>
</Tablelayout>

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.