注册界面实现

﹏ヽ暗。殇╰゛Y 2022-05-10 03:14 378阅读 0赞

代码如下:

  1. <ImageView
  2. android:id="@+id/iv"
  3. android:layout_width="70dp"
  4. android:layout_height="70dp"
  5. android:layout_centerHorizontal="true"
  6. android:layout_marginTop="50dp"
  7. android:background="@drawable/photo1"
  8. />
  9. <LinearLayout
  10. android:id="@+id/ll_number"
  11. android:layout_below="@id/iv"
  12. android:layout_centerHorizontal="true"
  13. android:layout_width="match_parent"
  14. android:layout_height="wrap_content"
  15. android:layout_margin="10dp"
  16. android:orientation="horizontal"
  17. android:background="#ffffff"
  18. >
  19. <TextView
  20. android:id="@+id/tv_name"
  21. android:padding="10dp"
  22. android:textSize="20sp"
  23. android:text="账号:"
  24. android:layout_width="wrap_content"
  25. android:layout_height="wrap_content"/>
  26. <EditText
  27. android:id="@+id/ed_name"
  28. android:hint="请输入账号"
  29. android:layout_marginLeft="5dp"
  30. android:padding="10dp"
  31. android:textSize="20sp"
  32. android:layout_width="match_parent"
  33. android:layout_height="wrap_content"
  34. android:background="@null"
  35. />
  36. </LinearLayout>
  37. <LinearLayout
  38. android:id="@+id/ll_password"
  39. android:layout_below="@id/ll_number"
  40. android:layout_centerHorizontal="true"
  41. android:layout_width="match_parent"
  42. android:layout_height="wrap_content"
  43. android:layout_marginLeft="10dp"
  44. android:layout_marginRight="10dp"
  45. android:orientation="horizontal"
  46. android:background="#ffffff"
  47. >
  48. <TextView
  49. android:id="@+id/tv_password"
  50. android:padding="10dp"
  51. android:textSize="20sp"
  52. android:text="密码:"
  53. android:layout_width="wrap_content"
  54. android:layout_height="wrap_content"/>
  55. <EditText
  56. android:id="@+id/ed_password"
  57. android:hint="请输入密码"
  58. android:layout_marginLeft="5dp"
  59. android:padding="10dp"
  60. android:layout_width="match_parent"
  61. android:layout_height="wrap_content"
  62. android:background="@null"
  63. android:textSize="20sp"
  64. android:inputType="textPassword"
  65. />
  66. </LinearLayout>
  67. <LinearLayout
  68. android:id="@+id/ll_gender"
  69. android:layout_below="@id/ll_password"
  70. android:layout_width="match_parent"
  71. android:layout_height="wrap_content"
  72. android:layout_marginLeft="10dp"
  73. android:layout_marginRight="10dp"
  74. android:orientation="horizontal"
  75. android:background="#ffffff"
  76. android:layout_marginTop="5dp"
  77. >
  78. <RadioGroup
  79. android:id="@+id/rdg"
  80. android:layout_width="match_parent"
  81. android:layout_height="wrap_content"
  82. android:orientation="horizontal">
  83. <RadioButton
  84. android:id="@+id/rdg_woman"
  85. android:textSize="25sp"
  86. android:text="女"
  87. android:checked="true"
  88. android:layout_marginLeft="10dp"
  89. android:layout_marginRight="10dp"
  90. android:layout_width="wrap_content"
  91. android:layout_height="wrap_content"
  92. />
  93. <RadioButton
  94. android:id="@+id/rdg_man"
  95. android:textSize="25sp"
  96. android:text="男"
  97. android:checked="true"
  98. android:layout_marginLeft="30dp"
  99. android:layout_marginRight="40dp"
  100. android:layout_width="wrap_content"
  101. android:layout_height="wrap_content"
  102. />
  103. </RadioGroup>
  104. </LinearLayout>
  105. <LinearLayout
  106. android:layout_below="@id/ll_gender"
  107. android:layout_width="match_parent"
  108. android:layout_height="wrap_content"
  109. android:layout_marginTop="5dp"
  110. android:layout_marginLeft="10dp"
  111. android:layout_marginRight="10dp"
  112. android:background="#ffffff"
  113. android:orientation="horizontal"
  114. >
  115. <Button
  116. android:id="@+id/btn_register"
  117. android:text="注册"
  118. android:textSize="15sp"
  119. android:layout_marginLeft="10dp"
  120. android:padding="10dp"
  121. android:layout_width="wrap_content"
  122. android:layout_height="wrap_content" />
  123. <Button
  124. android:id="@+id/btn_cancel"
  125. android:text="关闭"
  126. android:textSize="20sp"
  127. android:layout_marginLeft="30dp"
  128. android:padding="10dp"
  129. android:layout_width="wrap_content"
  130. android:layout_height="wrap_content" />
  131. </LinearLayout>

结果如下:

70

发表评论

表情:
评论列表 (有 0 条评论,378人围观)

还没有评论,来说两句吧...

相关阅读