Android EditText中添加图标的简单方法

只需要在布局文件中添加drawableLeft属性,我是在最左边添加了一个图片,我的代码:

            <EditText
                android:drawableLeft="@drawable/beijing1"
                android:id="@+id/name_et"
                android:layout_width="match_parent"
                android:layout_height="60dp"
                android:background="@drawable/edittext"
                android:hint="@string/inout_name"
                android:maxLength="15" />

猜你喜欢

转载自blog.csdn.net/chen_xiaobao/article/details/79711510