私はレイアウトを把握しようとしていますが、現時点では、1行に複数のフィールドを含むレイアウトを設定しようとしています。 5行、複数のフィールドのリストビューレイアウトのボタンを下側/上側に表示
例:このような、すべての回で上部または下部に上
Button
field A Field B Field C
field A Field B Field C
field A Field B Field C
field A Field B Field C
field A Field B Field C
これは私がこれまでのところ、私は下のボタンを表示することができたものであるが、私はできませんよ複数のフィールドを追加します。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<Button android:layout_width="fill_parent"
android:layout_height="wrap_content" android:id="@+id/ButtonCreate"
android:text="Create Game" android:layout_alignParentBottom="true" />
<ListView android:layout_width="fill_parent"
android:layout_height="fill_parent" android:id="@+id/list"
android:layout_alignParentTop="true" android:layout_above="@id/ButtonCreate" />
<ProgressBar style="?android:attr/progressBarStyleLarge" android:layout_width="wrap_content" android:id="@+id/progressBarBrowser" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_centerHorizontal="true"></ProgressBar>
</RelativeLayout>
上記のコードに下に表示されているように私は、テキストフィールドを追加しようとしましたが、成功せず:
<LinearLayout
android:orientation="vertical"
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="fill_parent">
<TextView
android:id="@+id/toptext"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:gravity="center_vertical"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:id="@+id/bottomtext"
android:singleLine="true"
android:ellipsize="marquee"
/>
</LinearLayout>
私はこのように私の活動でそれを呼び出しています:
listView.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, data));
任意のアイデアありがとう
フォローアップをいただきありがとうございます。この行を表すレイアウトの概念は、この記事を検索するのに役立ちました。http://www.softwarepassion.com/android-series-custom-listview-items-and-アダプター/。それは私のためにすべてをクリアした – Hoofamon