gpt4 book ai didi

android - 应用程序 :layout_marginBottom is not working well with android constraint layout

转载 作者:可可西里 更新时间:2023-11-01 18:45:09 25 4
gpt4 key购买 nike

下面的 layout_marginBottom 有什么不工作的原因吗?但是,如果我在第二个 View 上使用 layout_marginTop,它确实可以正常工作

<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ade4ad">
<TextView
android:id="@+id/first"
android:layout_width="90dp"
android:layout_height="40dp"
app:layout_marginBottom="10dp"
android:background="#000"/>
<TextView
android:id="@+id/second"
android:layout_width="90dp"
android:layout_height="40dp"
android:background="#fff"
app:layout_constraintTop_toBottomOf="@+id/first"/>
</android.support.constraint.ConstraintLayout>

最佳答案

为了

android:layout_marginBottom="20dp" 

工作得很好,你应该使用

app:layout_constraintBottom_toBottomOf="parent"

关于android - 应用程序 :layout_marginBottom is not working well with android constraint layout,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44931337/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com