listviewの各行をカスタマイズできるかどうか知りたいですか?いくつかの行にチェックボックスを追加したい、別のボタンなどにボタンを追加したい。* .xmlファイルをどのようにビルドするか?Android ListViewの各行をカスタマイズするにはどうすればよいですか?
ありがとうございます!
listviewの各行をカスタマイズできるかどうか知りたいですか?いくつかの行にチェックボックスを追加したい、別のボタンなどにボタンを追加したい。* .xmlファイルをどのようにビルドするか?Android ListViewの各行をカスタマイズするにはどうすればよいですか?
ありがとうございます!
あなたは次のような通常のレイアウトファイルを書き込むことができます:あなたのリストビューアダプタ機能で次に
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/lineItem">
<!-- The attribute name -->
<TextView android:id="@+id/attributeName" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_alignParentLeft="true"
android:textStyle = "bold" android:paddingTop = "2dp" android:textSize="16dp"/>
<!-- The attribute value just beneath the attribute name -->
<TextView android:id="@+id/attributeValue" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_alignParentLeft="true"
android:layout_below="@id/attributeName" android:textSize="12dp" android:paddingBottom="2dp" />
<!-- Now create button besides the line with right align -->
<Button android:layout_width="wrap_content"
android:background="@drawable/printbutton"
android:layout_height="wrap_content"
android:id="@+id/printbtn"
android:layout_centerInParent="true" android:layout_alignParentBottom="true"></Button>
</RelativeLayout>
public View getView(final int position, View convertView, ViewGroup parent)
あなたはこれが何であるか
convertView = mInflater.inflate(R.layout.listviewrow,null);
ラインを使用することができます私はやった。 (おそらくListAdapter
またはArrayAdapter
から)カスタムアダプタを作成するにつながる
えええええええええええええええええええええええんカスタムArrayAdapterを開発する必要があります。 チュートリアルhere:
私はそれがあなたの役に立つと思います。
はい、可能です。あなたには、多数のチュートリアルがあります。あなたは誰かが答える時間を無駄にしています。 –
http://stackoverflow.com/questions/8476217/two-views-in-each-list-item/8476380#8476380 原則は同じです。 – Jave