を記入し、それがコードだ次のとおりです。は動的</p> <p><a href="http://i.stack.imgur.com/0khRU.jpg" rel="nofollow">Click for screenshot</a></p> <p>..ので、私はこのように見えるの相対レイアウトを持って事前に定義された相対的なレイアウト
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="150dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/imageView"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:src="@drawable/image"
android:scaleType="fitXY" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="New Button"
android:id="@+id/button"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:background="#60000000"
android:textSize="30dp"
android:textAlignment="textEnd"
android:textColor="#ffffff" />
</RelativeLayout>
私は2つのものを持っています最初にこの相対レイアウトを繰り返し動的に使用し、イメージビューとテキストビューに異なるコンテンツを埋めます。
第2に、Relativelayoutを動的に並べ替えることをお勧めします。 like this練習は必要性のこの種のRecyclerView
を使用しているベスト
使用 'RecyclerView'のような類似した表情に –