如何创建一个四位数的密码Android布局
I want to create a layout for an Android app that has a numeric keypad and takes four digits to determine if it matches a preset passcode value.
我想为具有数字小键盘的Android应用程序创建布局,并使用四位数来确定它是否与预设的密码值匹配。
I have seen a few applications use this, so I would have thought that it was a high level widget of some description.
我已经看到一些应用程序使用它,所以我认为它是一些描述的高级小部件。
The only thing I can find that's remotely close to what I want is this:
我能找到的唯一一件与我想要的东西非常接近的是:
<EditText
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="numberPassword" >
<requestFocus />
</EditText>
But this isn't really what I'm looking for.
但这并不是我想要的。
Any input would be awesome and thanks in advance.
任何输入都会很棒,并提前感谢。
EDIT: Here's an image of the iOS dropbox app start screen that I'd like:
编辑:这是我想要的iOS保管箱应用程序启动屏幕的图像:
4 个解决方案
#1
4
Did you try adding this:
你尝试添加这个:
android:maxLength="4"
android:password="true"
This results in a more password like way.
这样可以产生更多密码。
Update: I'd implement four EditText and make them each maxLength="1". If you align them horizontally this should work :)
更新:我将实现四个EditText,并使每个maxLength =“1”。如果你水平对齐它们应该工作:)
更多相关文章
- 为什么我们应该将XMPP而不是JSON用于简单(仅文本)消息传递应用程序
- Android - 在一个应用程序中启动另外一个已经安装的应用程序或系
- Android混合应用程序:JQueryMobile ajax不支持https,但可以使用htt
- 第三部分:Android 应用程序接口指南---第二节:UI---第六章 对话框
- 如何将本机应用程序(android)与phonegap应用程序集成
- 为什么我的Android应用程序偶尔可以非常快地耗尽电池?
- 如何在android 5.0(L)中运行应用程序活动名称?
- Android应用程序启动过程上
- Java Android套接字连接。错误的IP地址导致应用程序停止响应