Android prompt input box

Source: Internet
Author: User

 

A friendly interface is very important when users need to input data. Therefore, if we can give users some prompts in the input box, it will improve the ease of use of the program, android provides us with this attribute, that is, Android: hint.

In addition, the textview of this program uses the shape attribute in Android. For more information, see my previous blog reposted.

View plaincopy to clipboardprint?
  1. <? XML version = "1.0" encoding = "UTF-8"?>
  2. <Tablelayout xmlns: Android = "http://schemas.android.com/apk/res/android"
  3. Android: Orientation = "vertical"
  4. Android: layout_width = "fill_parent"
  5. Android: layout_height = "fill_parent"
  6. >
  7. <Tablerow>
  8. <Textview
  9. Android: layout_width = "fill_parent"
  10. Android: layout_height = "wrap_content"
  11. Android: text = "username :"
  12. Android: textsize = "10sp"
  13. Android: Background = "@ drawable/bg_border"
  14. />
  15. <Edittext
  16. Android: layout_width = "fill_parent"
  17. Android: layout_height = "wrap_content"
  18. Android: hint = "Enter the Logon account"
  19. Android: selectallonfocus = "true"
  20. />
  21. </Tablerow>
  22. <Tablerow>
  23. <Textview
  24. Android: layout_width = "fill_parent"
  25. Android: layout_height = "wrap_content"
  26. Android: text = "Password :"
  27. Android: textsize = "10pt"
  28. Android: Background = "@ drawable/bg_border"
  29. />
  30. <Edittext
  31. Android: layout_width = "fill_parent"
  32. Android: layout_height = "wrap_content"
  33. Android: Password = "true"
  34. />
  35. </Tablerow>
  36. <Tablerow>
  37. <Textview
  38. Android: layout_width = "fill_parent"
  39. Android: layout_height = "wrap_content"
  40. Android: text = "phone number :"
  41. Android: textsize = "10pt"
  42. Android: Background = "@ drawable/bg_border"
  43. />
  44. <Edittext
  45. Android: layout_width = "fill_parent"
  46. Android: layout_height = "wrap_content"
  47. Android: hint = "Enter your phone number"
  48. Android: selectallonfocus = "true"
  49. Android: phonenumber = "true"
  50. />
  51. </Tablerow>
  52. <Button
  53. Android: layout_width = "wrap_content"
  54. Android: layout_height = "wrap_content"
  55. Android: text = "register"
  56. />
  57. </Tablelayout>

<? XML version = "1.0" encoding = "UTF-8"?> <Br/> <tablelayout xmlns: Android = "http://schemas.android.com/apk/res/android" <br/> Android: Orientation = "vertical" <br/> Android: layout_width = "fill_parent" <br/> Android: layout_height = "fill_parent" <br/> <tablerow> <br/> <textview <br/> Android: layout_width = "fill_parent" <br/> Android: layout_height = "wrap_content" <br/> Android: text = "username:" <br/> Android: textsize = "10sp" <br/> Android: Background = "@ drawable/bg_border" <br/> <edittext <br/> Android: layout_width = "fill_parent" <br/> Android: layout_height = "wrap_content" <br/> Android: hint = "Enter the Logon account" <br/> Android: selectallonfocus = "true" <br/> </tablerow> <br/> <textview <br/> Android: layout_width = "fill_parent" <br/> Android: layout_height = "wrap_content" <br/> Android: text = "Password:" <br/> Android: textsize = "10pt" <br/> Android: Background = "@ drawable/bg_border" <br/> <edittext <br/> Android: layout_width = "fill_parent" <br/> Android: layout_height = "wrap_content" <br/> Android: password = "true" <br/> </tablerow> <br/> <textview <br/> Android: layout_width = "fill_parent" <br/> Android: layout_height = "wrap_content" <br/> Android: text = "phone number:" <br/> Android: textsize = "10pt" <br/> Android: Background = "@ drawable/bg_border" <br/> <edittext <br/> Android: layout_width = "fill_parent" <br/> Android: layout_height = "wrap_content" <br/> Android: hint = "Enter your phone number" <br/> Android: selectallonfocus = "true" <br/> Android: phonenumber = "true" <br/> </tablerow> <br/> <button <br/> Android: layout_width = "wrap_content" <br/> Android: layout_height = "wrap_content" <br/> Android: TEXT = "register" <br/> </tablelayout> <br/>
Used shape File

View plaincopy to clipboardprint?
  1. <? XML version = "1.0" encoding = "UTF-8"?>
  2. <Shape xmlns: Android = "http://schemas.android.com/apk/res/android">
  3. <Solid Android: color = "#000000"/>
  4. <Stroke Android: width = "2dip" Android: color = "# ff0000"/>
  5. </Shape>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.