EditText为提供使用者输入之元件,
而其中包括许多属性提供不同之用途,
下面列举出EditTedxt常见的属性
而常见的type如下图所示
以下利用EditText进行简单的范例
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
tools:context=".MainActivity">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="请输入密码"
android:inputType="numberPassword"
android:singleLine="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
此范例type设定为numberPassword,
因此点开时会跳出数字键盘,
而输入的数字会自动进行隐藏
>>: Day17 Preparation of Gin and Env
1. 静态型别 VS. 动态型别 1.1 静态型别的例子 以Java为例: int x 在宣告x变数...
while statement If the statement is true, the code...
什麽是 Read-Write-Lock Pattern? 多读单写。将 lock 分为 read 与...
摘要 作业流程 安装环境/套件 上传打包後模型 介绍Vim编辑器 惨痛经历 内容 作业流程(今日进度...
提款 接下来,写个提款功能 # cogs/money.py @commands.command() ...