【问题标题】:Default Margin in material layout,材料布局中的默认边距,
【发布时间】:2021-09-01 22:22:16
【问题描述】:

我正在尝试制作一个 TextInputLayout ,其中我采用了一个 TextInputEditText ,但即使在将 TextInputEditText 边距设置为 0 后,内部也有一个默认边距布局,我知道为什么,但有点困惑。

Screenshot for the problem

<com.google.android.material.textfield.TextInputLayout
        style="@style/Widget.MaterialComponents.Button.OutlinedButton"
        android:id="@+id/textInputLayout2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="Email Id"
        android:layout_marginLeft="40dp"
        android:layout_marginRight="40dp"
        app:layout_constraintBottom_toTopOf="@+id/TXTpassword"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/IMGlogo">

        <com.google.android.material.textfield.TextInputEditText
            android:id="@+id/TXTemail"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>
   </com.google.android.material.textfield.TextInputLayout>

【问题讨论】:

  • 你为什么在TextInputLayout中使用Widget.MaterialComponents.Button.OutlinedButton这种风格?

标签: android android-layout gwt-material-design


【解决方案1】:

尝试使用

android:insetBottom="0dp" 
android:insetTop="0dp"
android:insetRight="0dp"
android:insetLeft="0dp"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-10-26
    • 1970-01-01
    • 1970-01-01
    • 2015-07-13
    • 2017-01-16
    • 2021-07-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多