ConstraintLayout 下 layout_marginLeft 属性无效问题

ConstraintLayout 下 layout_marginLeft 属性无效问题

需要添加 app:layout_constraintLeft_toLeftOf="parent" 属性

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <com.hrm.baidusdk.customize.DragFloatActionButton
        android:id="@+id/floatButton"
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:background="@color/colorAccent"
        android:clickable="true"
        tools:ignore="MissingConstraints,RtlSymmetry"
        android:focusable="true"
        android:layout_marginLeft="50dp"
        app:layout_constraintLeft_toLeftOf="parent"/>

</androidx.constraintlayout.widget.ConstraintLayout>
posted @ 2020-11-23 16:17  花染梦  阅读(2249)  评论(0编辑  收藏  举报