1. 常见属性

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:padding="15dp"
tools:context=".EditTextActivity">
<EditText
android:id="@+id/et_1"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginBottom="15dp"
android:autofillHints=""
android:hint="@string/username"
android:inputType="text"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:textColor="@color/red"
android:textSize="16sp" />
</RelativeLayout>
2. 自定义样式

照片放在指定路径下, 可以按照原有的招嫖改动比例大小.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:padding="15dp"
tools:context=".EditTextActivity">
<EditText

本文介绍了Android中EditText的使用,包括常见的布局属性设置,如宽度、高度、提示文本等;自定义输入框样式,如背景形状、图标显示;以及如何添加文本监听事件,实现对输入内容的实时跟踪。通过实例展示了EditText在登录界面的应用,为Android开发提供基础参考。
最低0.47元/天 解锁文章
785

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



