小编Ron*_*___的帖子

app:layout_marginBottom与android约束布局不兼容

是否有任何理由为什么以下layout_marginBottom不起作用?但是,如果我在第二个视图上使用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>
Run Code Online (Sandbox Code Playgroud)

android margin android-constraintlayout

21
推荐指数
4
解决办法
6270
查看次数

标签 统计

android ×1

android-constraintlayout ×1

margin ×1