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