【发布时间】:2017-04-04 03:27:48
【问题描述】:
不知何故,我似乎找不到原因,我的片段的行为与我预期的不同。
我想要完成的事情:
我在自动取款机上得到什么:
我的问题 - 我怎样才能在这里达到目标 - 在我的情况下,我的数据库示例中的文本与几个蓝色方块相邻。
XML:
activity_main
rec_item
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="4dp">
<ImageView
android:id="@+id/category_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:adjustViewBounds="true"
android:contentDescription="@null"
android:scaleType="centerCrop"
android:background="#b7b7ff"/>
<TextView
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:minHeight="48dp"
android:paddingBottom="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="16dp"
android:background="#E237474F"
style="@style/TextAppearance.AppCompat.Subhead.Inverse"
tools:text="TEST"/>
</FrameLayout>
rec_list
<android.support.v7.widget.RecyclerView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"/>
【问题讨论】:
标签: android android-layout android-fragments android-recyclerview