android-edittext 相关问题

EditText是Android应用程序中的标准文本输入窗口小部件。如果用户需要在应用程序中输入文本,这是他们执行此操作的主要方式。

在文本视图中设置字母之间的空格

有没有办法将字母之间的自定义空间(以像素为单位)设置为 editText?我只发现如何在行之间设置空格,但在同一行的字母之间设置机器人

回答 5 投票 0

带有 edittext 的 xml 文件给出错误:tittletxt <EditText>:触摸目标尺寸太小如何修复

我有一个简单的android应用程序,其中包含带有简单编辑文本和按钮以及回收器视图的xml文件 在我的 xml 文件下面 我有一个简单的 android 应用程序,其中包含带有简单编辑文本和按钮以及回收器视图的 xml 文件 在我的 xml 文件下面 <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <EditText android:id="@+id/titletxt" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="24dp" android:hint="Enter Information" app:layout_constraintBottom_toTopOf="@+id/button" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> <Button android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginTop="20dp" android:layout_marginBottom="40dp" android:text="Submit" app:layout_constraintBottom_toTopOf="@+id/recycler" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.498" app:layout_constraintStart_toStartOf="parent" /> <androidx.recyclerview.widget.RecyclerView android:id="@+id/recycler" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#E8DDDD" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" /> </LinearLayout> 当我构建应用程序或运行它时,出现以下错误 titletxt <EditText>: Touch target size too small

回答 0 投票 0

如何将光标放在编辑文本的行尾

在强制换行的情况下,光标可以定位到行尾。 但是,在自动换行的情况下,光标不能定位到末尾。 有什么办法可以做到吗

回答 0 投票 0

以 29(Q) 作为目标 API 的 28(P) 的 EditText 句柄颜色

到目前为止,我一直在使用反射,因此更新了 editTexts 的选择句柄。在我更新到目标 api 29(Q) 之前,它一直运行良好。 似乎谷歌做了一些更新(或 Java,而不是...

回答 1 投票 0

“尽管 Android 在 Activity 开始时将焦点放在布局中的第一个文本字段”这一说法是否仍然有效?

我在处理输入法可见性部分找到了主题声明 我想尝试在活动开始时打开我的键盘。但是,我唯一的 EditText 并不专注于活动开始。我的躺...

回答 0 投票 0

为什么第二次点击编辑文本字段会导致应用程序错误?安卓-JAVA

我有一个获取数字的编辑文本字段。当场地空旷时,我可以随意触摸它。如果甚至出现一个字符并且我关闭键盘,我第二次点击 edittext ...

回答 0 投票 0

如何在 Android Auto 中使用 EditText 输入用户数据?我的App需要3个EditText来收集用户的3个数据,实现计算并给出响应

我知道可以使用字段(我只是不知道它们是否是 EditText)来收集 Android Auto 中的用户数据,如 CarStream、CarTube、Fermata Auto 等。然而这些开发者...

回答 0 投票 0

数组中的许多编辑文本[重复]

我有 20 个 edittext、layout 和 autocompletetextview 我想访问它们以及使用数组的所有内容 我在附加他们的 ID 时遇到错误。我哪里错了 线性布局[]

回答 2 投票 0

如何在edittext中将android键盘弹出到最右边?

我正在使用编辑文本,我的应用程序处于横向模式。 我的 Edittext 在 Screen 的右侧。当我点击 edittext 然后在中间弹出的键盘给用户编辑带来了糟糕的用户体验......

回答 0 投票 0

Android 绑定 - 获取所有 EditText 值

我有一项活动,其中包含 EditText 字段。使用数据绑定,所以我可以像这样从 EditText 获取字符串值: 绑定.printWidth.getText().toString() 有没有办法让所有的 id 和值 f...

回答 0 投票 0

如何为 edittext android 创建视图以从上到下、从左到右显示渐变阴影

我想在 Android 中为我的编辑文本制作背景,就像这张图片一样,任何人都知道如何创建这个视图,请提供一些示例。谢谢... 图片说明在这里

回答 0 投票 0

在 EditText 中快速滚动

我的 EditText 有时可以有非常大的文本(>1000 行),我希望能够快速到达开始或结束所以我认为快速滚动是解决方案,但是它不适用于

回答 2 投票 0

RecyclerView 中的 EditText 在您键入时不会自动向上滚动

我在 RecyclerView 行中有一个固定高度的 EditText。在我键入时,如果文本光标向下移动超过可视区域的底部,控件不会自动向上滚动以显示当前行...

回答 0 投票 0

EditText 字符串表现为单个字符?喜欢谷歌计算器?

这里 sin( 表现为单一实体。我该如何实现呢? 我想我需要添加或删除字符。但在谷歌计算器中,选择也将其捕获为单个实体。怎么样?

回答 0 投票 0

如何去除 Android 文本样式 (EditText)

当用户粘贴具有粗体/斜体等样式的密码文本时,我感到非常困惑, 如何将文本更改为纯文本/普通文本? 我试过在谷歌上搜索,但我只能找到 &

回答 0 投票 0

Android EditText 不接受我物理键盘上的“Ü”“Ä”和“Ö”

我正在尝试为 android 创建一个应用程序并获得一个带有 editText 的页面。当专注于 editText 时,虚拟键盘打开,我可以用它来打字。 但是,我也激活了...的能力

回答 0 投票 0

从另一个 EditText 更改 EditText 中的文本 [关闭]

有人知道是否可以从另一个 EditText 更新编辑文本吗?当我尝试在 afterTextChanged 中使用文本观察器执行此操作时,我立即崩溃。好像找不到vi...

回答 0 投票 0

Android studio 如何在 edittext 中接收短信?

我正在构建一个应从指定号码接收文本消息的应用程序。 无论如何在 Edittext 中接收文本消息。这是接收短信的类: 类 SMSReceiver 扩展...

回答 1 投票 0

如何在它的末尾创建带有十字(x)按钮的EditText?

是否有像 EditText 这样包含十字按钮的小部件,或者是否有自动创建它的 EditText 的任何属性?我想要十字按钮删除写在

回答 18 投票 0

Android 中带有分隔底线的自定义 EditText

我需要使带有分隔底线的 EditText 如下图所示 我尝试把EditText和四个ImageView放到RelativeLayout中。 我需要使带有分隔底线的 EditText 如下图所示 我试过把EditText和四个ImageView放到RelativeLayout中 <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content"> <RelativeLayout android:layout_width="wrap_content" android:layout_height="40dp" android:layout_alignParentEnd="true" android:layout_alignParentRight="true" android:layout_marginLeft="20dp" android:layout_marginRight="20dp" android:gravity="center"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:gravity="center" android:orientation="horizontal"> <EditText android:id="@+id/et_code" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@null" android:singleLine="true" android:textColor="@color/black" android:textSize="16dp" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:orientation="horizontal"> <ImageView android:layout_weight="1" android:layout_width="wrap_content" android:layout_height="1px" android:alpha="0.3" android:background="@color/black" /> <ImageView android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:layout_weight="1" android:layout_width="wrap_content" android:layout_height="1px" android:alpha="0.3" android:background="@color/black" /> <ImageView android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:layout_weight="1" android:layout_width="wrap_content" android:layout_height="1px" android:alpha="0.3" android:background="@color/black" /> <ImageView android:layout_weight="1" android:layout_width="wrap_content" android:layout_height="1px" android:alpha="0.3" android:background="@color/black" /> </LinearLayout> </RelativeLayout> </RelativeLayout> 这是非常糟糕的解决方案,因为在小屏幕中数字开始移出。 使用this库。 正如其 GitHub 页面所说: <com.github.glomadrian.codeinputlib.CodeInput android:layout_marginTop="20dp" android:layout_width="wrap_content" android:layout_height="wrap_content" app:underline_color="#457ad1" app:underline_selected_color="#9e1ace" app:text_color="#b12eff" app:hint_color="#77ce9d" app:hint_text="Pin code" app:codes="4" /> 添加依赖项 compile 'com.github.glomadrian:CodeInput:1.1@aar' 为此,您需要在水平方向的线性布局中添加四个 edittext,每个宽度 = "0dp" 和 weight = "1"。像这样的 <LinearLayout android:layout_width="match_parent" android:layout_height = "wrap_content" android:orientation="horizontal" > <Edittext android:layout_width="0dp" android:layout_height = "wrap_content" android:layout_weight = "1" .... add other required attributes /> <Edittext android:layout_width="0dp" android:layout_height = "wrap_content" android:layout_weight = "1" .... add other required attributes /> <Edittext android:layout_width="0dp" android:layout_height = "wrap_content" android:layout_weight = "1" .... add other required attributes /> <Edittext android:layout_width="0dp" android:layout_height = "wrap_content" android:layout_weight = "1" .... add other required attributes /> </LinearLayout> 这仅用于说明,您需要使用所需的样式和属性以自己的方式实现它。

回答 2 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.