为什么图标出现在 EditText
/divider 之前?
这是我的代码:
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/fragment_sign_in"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="5dp"
tools:context="com.*.*.*.SignInFragment">
<!-- This is the EditText -->
<com.rey.material.widget.EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableStart="@drawable/email"
android:drawableLeft="@drawable/email"
android:padding="0dp"
android:hint="test"
app:et_dividerHeight="1dp" />
</android.support.constraint.ConstraintLayout>
最佳答案
你可以使用
android:drawablePadding="5dp" // Add your own values
可绘制对象和文本之间的填充。
Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters).
你可以试试
android:drawableLeft="2dp"
android:paddingLeft="3dp"
The drawable to be drawn to the left of the text.
关于android - 为什么 drawableLeft 出现在 EditText 之外?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39121588/