Android开发实践18 EditText控件的使用.pptxVIP

  • 1
  • 0
  • 约1.16千字
  • 约 10页
  • 2026-09-24 发布于陕西
  • 举报

EditText编辑框作用输入、编辑文本继承关系父类TextView

EditText编辑框实现效果提示信息hint输入类型inputTypetextPasswordnumberdatephonenumberPassword

EditText编辑框添加功能获取文本getText()获取焦点requestFocus()1.控件属性大部分能找到相应的getXXX(),setXXX()方法2.在代码中调用方法对属性进行修改后,原xml文件中的对应设置将不起作用特别提示:

EditText编辑框其他属性及对应方法设置可以获取焦点setFocusable(true)setFocusableInTouchMode(true)android:focusable=trueandroid:focusableInTouchMode=true

EditText编辑框其他属性及对应方法设置默认键盘类型//中文键盘et.setInputType(EditorInfo.TYPE_CLASS_TEXT);//英文键盘et.setInputType(EditorInfo.TYPE_TEXT_VARIATION_URI);//数字键盘et.setInputType(InputType.TYPE_CLASS_NUMBER);//不显示软键盘et.setInputType(InputType.TYPE_NU

文档评论(0)

1亿VIP精品文档

相关文档