her*_*mt2 6 android android-layout android-xml android-recyclerview android-constraintlayout
我有一个 a 的RecyclerView内部,ConstraintLayout其顶部从a的底部开始textView,其底部向下延伸到父级。我希望此中的项目RecyclerView默认为RecyclerView. 我尝试添加gravity="bottom"并且还尝试了与foregroundGravity和相同的事情layout_gravity。我还尝试添加layout_gravity="bottom"到我的recyclerView项目的布局。尽管如此, 中的所有项目recyclerView仍然默认为顶部。我能做些什么来确保物品在底部吗?这是xml:
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/my_tv"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="needed to unlock next coupon"
android:textColor="@color/gray"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/irrelevant_tv"
android:layout_marginTop="@dimen/spacing_tiny"
android:gravity="center"
/>
<android.support.v7.widget.RecyclerView
android:id="@+id/rv"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="@dimen/spacing_xl"
android:paddingTop="@dimen/spacing_large"
android:overScrollMode="always"
app:layoutManager="android.support.v7.widget.LinearLayoutManager"
app:layout_constraintTop_toBottomOf="@id/my_tv"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</android.support.constraint.ConstraintLayout>
Run Code Online (Sandbox Code Playgroud)
我不想做wrap_content的recyclerView任何,因为否则就不是scrollable(我一直在这3项recyclerView,并根据用户的显示设置,recyclerView可以得到被推离屏幕,这需要我可以滚动)
| 归档时间: |
|
| 查看次数: |
3489 次 |
| 最近记录: |