私はカードのコンセプトを使用する必要があるアンドロイドスタジオのページを作成しています。カードには人の画像と画像の下にある人物の名前が含まれています。例えば、アンドロイド・マシュマロの連絡先リスト(グリッド・ビュー内の各連絡先がタイルとして表示されます)。androidでカードビューを動的に使用する
私はさまざまな方法で試しましたが、これを修正することができませんでした。私はカードを生成したが、私は人々の数に基づいて自動的に生成されなければならないタイル張りの形状にさらに4枚のカードを必要とするどのよう This is the Image of how the final output should look like.
<android.support.v7.widget.CardView
android:layout_width="104dp"
android:layout_height="wrap_content"
android:id="@+id/cardview">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="25dp"
android:src="@drawable/calendar_screen_launch_forcard"
android:id="@+id/coach_img"
android:paddingTop="5dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/person_name"
android:text="Mark Linonel Jr"
android:textSize="10dp"
android:singleLine="false"
android:paddingTop="70dp"
android:paddingLeft="20dp"
android:background="#00000000" />
</android.support.v7.widget.CardView>
これ。
ありがとう。
RecyclerViewとアダプタを使用するとかなり簡単に使用できます。必要に応じて開発した回答を書くことができます。 – xNeyte
はい、それは本当に役立つでしょう。ありがとうございました –