`
mapdigit
  • 浏览: 242399 次
文章分类
社区版块
存档分类
最新评论

Android ApiDemos示例解析(165):Views->Layouts->TableLayout->10. Simple Form

 
阅读更多

前面介绍了使用LinerLayout和RelativeLayout构造Simple Form:

Android ApiDemos示例解析(145):Views->Layouts->LinearLayout->5.Simple Form

Android ApiDemos示例解析(152):Views->Layouts->RelativeLayout->2.Simple Form

本例使用LabelLayout构造了一个简单输入表单:

<TableLayout xmlns:android=”http://schemas.android.com/apk/res/android”
android:layout_width=”match_parent”
android:layout_height=”match_parent”
android:stretchColumns=”1″>

<TableRow>
<TextView
android:text=”@string/table_layout_10_user”
android:textStyle=”bold”
android:gravity=”right”
android:padding=”3dip” />

<EditText android:id=”@+id/username”
android:text=”@string/table_layout_10_username_text”
android:padding=”3dip”
android:scrollHorizontally=”true”/>
</TableRow>

<TableRow>
<TextView
android:text=”@string/table_layout_10_password”
android:textStyle=”bold”
android:gravity=”right”
android:padding=”3dip” />

<EditText android:id=”@+id/password”
android:text=”@string/table_layout_10_password_text”
android:password=”true”
android:padding=”3dip”
android:scrollHorizontally=”true” />
</TableRow>

<TableRow
android:gravity=”right”>

<Button android:id=”@+id/cancel”
android:text=”@string/table_layout_10_cancel” />

<Button android:id=”@+id/login”
android:text=”@string/table_layout_10_login” />
</TableRow>
</TableLayout>

android:stretchColumns=”1″ 表示第二列将占据表格剩余空间,注意EditText 的android:scrollHorizontally 属性,当EditText输入多行时,该行高度也会跟着变化:

分享到:
评论

相关推荐

    Android ApiDemos示例解析(26):App->Notification->IncomingMessage

    NULL 博文链接:https://kakukemeit.iteye.com/blog/1806388

    android apidemos示例解析

    android apidemos代码的示例解析,讲的挺全的

    Android ApiDemos apk

    Android ApiDemos apk, 包括Android presentation双屏异显 demon, App&gt;Activity&gt;Presentation

    Android ApiDemos4.4 示例解析

    最新版ApiDemos Android SDK 中带有很多例子,其中ApiDemo 详细介绍了Android 平台主要API,分成了 · App · Content · Graphics · Media · OS · Text · Views 几个大类,每个大类又分为几个小类,...

    jdk-8u202-linux-x64-demos.tar.gz

    demos :jdk-8u202-linux-x64-demos.tar.gz

    jdk-8u202-linux-arm64-vfp-hflt-demos.tar.gz

    demos :jdk-8u202-linux-arm64-vfp-hflt-demos.tar.gz

    最新Android apidemos

    最新Android apidemos

    FairyGUI-Unity-Plugin-3.4.0.zip

    Run demos in Assets/FairyGUI/Examples/Scenes. The UI project is in Examples-UIProject.zip, unzip it anywhere. Use FairyGUI Editor to open it. Using FairyGUI in Unity: * Place a UIPanel in scene by ...

    Ehlib_6.1.129

    &lt;EhLib Archive&gt; \ Demos \ DBVertGridEh.SimpleDemo \ Project1.dpr compiled project: &lt;EhLib Archive&gt; \ Demos \ Bin \ DBVertGridEh.SimpleDemo.Exe * There are changes in the grids inheritance tree: ...

    Ehlib6.1.129

    &lt;EhLib Archive&gt; \ Demos \ DBVertGridEh.SimpleDemo \ Project1.dpr compiled project: &lt;EhLib Archive&gt; \ Demos \ Bin \ DBVertGridEh.SimpleDemo.Exe * There are changes in the grids inheritance tree: ...

    Android6.0 ApiDemos.apk

    从官方预览包里提取的Android6.0 ApiDemos.apk,方便安装在真机上查看实例的实际效果。

    Microsoft.Premium.DP-300.by-.VCEup-.82q-DEMOS.pdf

    Microsoft.Premium.DP-300.by_.VCEup_.82q-DEMOS.pdf

    android的ApiDemos

    API Demos 是 Google 为了 Android 开发者所提供的一个 Android API 合集,其中包含了很多的 API 范例,同时遵循了良好的代码规范,是一个值得开发者研究和学习的典型。android的ApiDemos,需要解压缩后使用。

    LigerUI V1.1.0

    api ------------- API目录 demos ------------- 本地demos目录 lib ------------- 框架源代码目录 index.htm ------------- 主页面 loading.gif ------------- loading图标 welcome.htm ------------- 欢迎页面 ...

    jdk-8u231-solaris-x64-demos.tar.gz

    文件名称: jdk-8u231-solaris-x64-demos.tar.gz 文件大小: 8.43 MB (8,846,115 字节) MD5: 3b62803c4e86b40f1a83b68be7bce224 SHA1: 3aba5de2157163b949179a5b654494da05b4da9c SHA256: 774c5d41a1422d22d026eaaa39...

    red5-1.0.0-webapps-demos.zip

    r下载后,解压,把解压后的文件直接放入到red5webaaps下

    android ApiDemos

    android APIdemos,android 源码简单使用demos

    Android 5.1 ApiDemos.apk

    Android 5.1的ApiDemos安装包

    jdk-8u202-linux-arm32-vfp-hflt-demos.tar.gz

    demos :jdk-8u202-linux-arm32-vfp-hflt-demos.tar.gz

    sciter-sdk-4.0.0.7

    [inspector] Fix of "Error: dimensions are less or equal to zero at @2@10.postSnapshot (sciter:debug-peer.tis(253))" [css] box-shadow caching fix. |dropdown&gt;, popup scroll to current selected item. ...

Global site tag (gtag.js) - Google Analytics