私はアンドロイドの開発に新しく、太字のヘッダー
と各項目の小さい説明を持つリストを作成しようとしています。
http://i.stack.imgur.com/UVqzq.png
これは私がして起動する必要がXMLである:(申し訳ありませんまだ画像を投稿することはできません)ここに示したような twoLineListItemの適切な使用方法
<LinearLayout android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TwoLineListItem android:layout_width="fill_parent"
android:layout_height="wrap_content" android:mode="twoLine">
<TextView android:textAppearance="?android:attr/textAppearanceLarge"
android:id="@android:id/text1" android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<TextView android:layout_below="@android:id/text1"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_alignLeft="@android:id/text1" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:id="@android:id/text2" />
</TwoLineListItem>
</LinearLayout>
は、配列からリストを移入する方法はあります別のXMLファイルで?そうでない場合、Javaコードからこのようなリストをどのように埋め込むのでしょうか?私が言ったように、私は開発には新しいので、おそらく私は離れています。入力をありがとう!
私はアプリケーションの別のセクションでリストビューを持っていましたが、リスト内のアイテムごとに1つのタイプのテキストしか表示できないという印象を受けました。入力いただきありがとうございます、私はそれをさらに調べます。 – JP2014
それはインスタンス化する方法によって異なります。 BaseAdapterクラスをサブクラス化して、リストビューに必要なビューをフィードできます。オンラインでカスタムリストビューの例が何百もあります。 – Falmarri