使用Android常用控件与布局实现美观的登录页面
编码前介绍:
使用知识点:EditText、LinearLayout、ImageView、TextView、selector、shape
实现效果:
第一步:新建一个LinearLayout
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <!-- EditText layout_width:把宽设置为手机宽度 layout_height:高设置为文本宽度 hint:设置提示字符为请输入用户名 textSize:设置字体大小为22dp layout_marginTop:设置外边距Top为10dp background:设置背景样式从选择器中获取 --> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="请输入用户名" android:textSize="22dp" android:layout_marginTop=