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>


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM