ウェブアプリケーション,インジェクション,コマンドインジェクション

Androidアプリ開発 Viewをつかったインターフェースデザイン

Viewの位置取りのためにTableLayoutを使う

Using TableLayout for View Positioning

TableLayoutグループは列と行の中に見られます。
<TableRow>要素を使いテーブルの行を明示します。
それぞれの行は1つ以上のViewを含んでいて
それぞれのViewはフォームの行セルに配置します。
それぞれの列の幅は、列にあるそれぞれのセルの一番大きな幅に
合わせて決められます。
以下にTableLayoutの使い方を示します。
TableLayoutのViewグループを含んだactivity_main.xmlファイルに
以下のコード部があると想定します。

<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   <TableRow>
        <TextView
       android:text="User Name:"
       android:width="120dp" />
     EditText
       android:id="@+id/txtUseName"
       android:widht="200dp" />
   </TableRow>
   <TableRow>
     <TextView
       android:text="Password:" />
     <EditText
       android:id="@+id/txtPassword"
       android:password="true" />
   </TableRow<
     <TableView />
     <CheckBox android:id="@+id/chkRememberPassword"
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
       android:text="Remember Password" />
   <TableRow>
   <TableRow>
     <Button
       android:id="@+id/buttonSignIn"
       android:text="Log In" />
   </TableRow>
<TableLayout>

このコードで注意するのは、
TableLayoutに2つの列と4つの行があることです。
TextViewパスワードの直下のセルは、空の<TextView />要素と
ともに事前設定されます。



ホーム
便利堂ロゴ
inserted by FC2 system