Android studio新建一个项目。修改XML如下:
其中Activity名称为:MyControlText。
<?xml version="1.0" encoding="utf-8"?><!--线性布局-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MyControlText">
<!--线性布局嵌套-->
<!-- 编辑文本控件-->
<!-- hint:暗示-->
<!-- maxLength:输入字符最大长度-->
<LinearLayout
android:layout_width

本文档展示了如何在Android Studio中新建项目,并修改XML布局文件以创建一个包含用户名和密码输入框以及登录按钮的界面。布局采用线性布局管理,编辑文本控件用于用户输入,同时设置了hint和maxLength属性。
最低0.47元/天 解锁文章
844

被折叠的 条评论
为什么被折叠?



