我是新的Android开发但是我已经在iOS中使用UICollectionView实现了附加图像但是我想知道是否可以在android中实现相同的。
我已经对网格视图以及“包含”标记进行了一些初步研究。
可以显示或隐藏图块,具体取决于存储在其他位置的变量。
我正走在正确的轨道上吗?
答案 0 :(得分:1)
RecyclerView的每一行都可以有以下结构
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_weight="1"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent">
<Button
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"/>
<Button
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"/>
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
</LinearLayout>