设置输入框默认提示内容 public final void setHint(CharSequence hint) android:hint=" 请输入待显示文字"
设定输入框内容首字母大写
android:capitalize=“true”
设置输入框单行/多行显示 android:singleLine =“true” EditText的事件处理 private当EditText TextWatcher 的 Text watcher 改变时= new 我们希望得到通知 TextWatcher(){
***@Override public可以使用 void afterTextChangedTextWatcher接口来实现对(Editable s) { EditText 控件内容变化的监听 } ***@Override 定义一个实现该接口的匿名内部类 public void beforeTextChanged(CharSequence s, int start, int count, int after) { } ***@Override 在 EditText 上注册该 TextWatcher 实例 public void onTextChanged(CharSequence s, int start, int before, int count) {
} }; EditText et = (EditText)findViewById(); (watcher); RelativeLayout介绍 RelativeLayout,顾名思义,就是以“相对”位 置/对齐为基础的布局方式。