Android约束布局-将视图固定到页面底部和另一个视图下方(不在中间)

问题描述 投票:0回答:1

我的ConstraintLayoutNestedScrollView之内。在此ScrollView(具有fillViewport="true")的底部,我总是想要一个按钮。因此,我将按钮设置为app:layout_constraintBottom_toBottomOf="parent",并将其正确固定在底部。但是,我有一个可扩展的RecyclerView,它在扩展时会覆盖按钮,因为在按钮和列表之间没有设置约束。如果添加app:layout_constraintTop_toBottomOf="@id/expandableRecyclerView",该按钮将不再被覆盖-但是该按钮不再固定在页面底部,它位于未展开的列表和页面底部之间。

我如何设置这两个约束,但是告诉按钮更喜欢被约束在视图底部?在下面,您可以看到在两个约束之间放置的按钮的图像。我希望将其固定在底部。

image

谢谢。

android android-constraintlayout
1个回答
0
投票

[好,很抱歉张贴。经过5分钟的修改后,我发现设置app:layout_constraintVertical_bias="1"解决了我的问题。

© www.soinside.com 2019 - 2024. All rights reserved.