发布于2022年11月4日2年前 Android Studio 登陆注册界面设计 本次UI界面 http://note.youdao.com/yws/res/2280/E4FCEE8C4E5D4AD398C29A3432562FC71.首先设置成线性布局,添加orientation属性,设置成垂直android:orientation="vertical"设置padding为8dp(Padding 为内边框,指该控件内部内容,如文本/图片距离该控件的边距)android:padding="8dp"2.建立一个testview写标题 android:layout_width="match_parent" android:layout_height="wrap_content" android:text="账号登录" android:textSize="40dp"/>标题字体大小 40dp(android:textSize=“40dp”)3. 建立两个editview,输入框要让Edittext单行显示android:maxLines="1"限制显示文本长度,超出不显示android:maxLength="10"文本为空时候显示的文本android:hint="请输入你的账号(最多十个字符)"文本过长时,省略号显示在结尾android:ellipsize="end"距离顶部的距离android:layout_marginTop="80dp"4. 建立登录按钮,buttonandroid:layout_gravity是用来设置该view相对与父view 的位置.比如一个button 在linearlayout里,你想把该button放在linearlayout里靠左、靠右等位置就可以通过该属性设置android:layout_gravity="center"5. 添加一个相对布局RelativeLayout,在里面建立CheckBox控件 android:id="@+id/cb_rm" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="记住密码" android:textSize="18dp" />6.再在里面建立一个testview(忘记密码) android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:text="忘记密码" android:textColor="#9E2222" android:layout_centerVertical="true" android:textSize="18dp" />将控件的右边缘和父控件的右边缘对齐android:layout_alignParentRight="true"将控件置于垂直方向的中心位置android:layout_centerVertical="true"
创建帐户或登录后发表意见