EditText设置提示用户输入界面
显示效果:
Main.xml
:完成了上述界面以及等待输入的效果
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<!-- background: 设置背景色,可以覆盖框中原有的横线
drawableLeft: 指定的图片放在输入提示的左侧,图片的大小可在其xml调整
drawablePadding:图片与输入提示的间距
inputType: 例如phone只能输入电话号码
paddingBottom: 图片和文字距离框底部的距离 -->
<EditText
android:layout_width="match_parent"
android:layout_height="200dp