Android 安卓手机代码
我正在努力在屏幕上获得附加的布局,特别是破折号,它们的行为就像一个单位数的文本字段,因为这是一个代码,下一个数字必须跳转到下一个文本字段,如果这是我必须使用的。 当用户收到代码时,他必须输入4位数字,但每个字段一个数字。 我认为这幅画是不言自明的。谢谢。您可以根据需要使用此易于实施和定制的功能 请检查下面的代码是否正常工作。只需将下面的代码复制粘贴到xml布局文件中即可 在执行此操作的edittext中设置MaxLength=1 请根据您的要求提供保证金Android 安卓手机代码,android,android-layout,textfield,Android,Android Layout,Textfield,我正在努力在屏幕上获得附加的布局,特别是破折号,它们的行为就像一个单位数的文本字段,因为这是一个代码,下一个数字必须跳转到下一个文本字段,如果这是我必须使用的。 当用户收到代码时,他必须输入4位数字,但每个字段一个数字。 我认为这幅画是不言自明的。谢谢。您可以根据需要使用此易于实施和定制的功能 请检查下面的代码是否正常工作。只需将下面的代码复制粘贴到xml布局文件中即可 在执行此操作的edittext中设置MaxLength=1 请根据您的要求提供保证金 我认为这个链接可以帮助你看起来很有希望
我认为这个链接可以帮助你看起来很有希望,会在一段时间内更新你。TKS@Meenal tks伙计!效果很好!伟大的它对你有用
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_test"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:text="ENTER CODE"
android:textSize="18sp"
android:textColor="@android:color/holo_blue_dark"
android:layout_gravity="center"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_margin="10dp"
android:layout_gravity="center"
android:layout_height="wrap_content">
<EditText
android:layout_width="0dp"
android:layout_weight="1"
android:imeOptions="actionNext"
android:maxLength="1"
android:inputType="number"
android:layout_height="wrap_content" />
<EditText
android:layout_width="0dp"
android:layout_weight="1"
android:imeOptions="actionNext"
android:maxLength="1"
android:inputType="number"
android:layout_height="wrap_content" />
<EditText
android:layout_width="0dp"
android:layout_weight="1"
android:imeOptions="actionNext"
android:maxLength="1"
android:inputType="number"
android:layout_height="wrap_content" />
<EditText
android:layout_width="0dp"
android:layout_weight="1"
android:imeOptions="actionDone"
android:maxLength="1"
android:inputType="number"
android:layout_height="wrap_content" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:text="00:32"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:layout_height="wrap_content" />
<TextView
android:layout_width="wrap_content"
android:text="Resend Code"
android:textSize="15sp"
android:textColor="@android:color/holo_blue_dark"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:layout_height="wrap_content" />
<Button
android:layout_width="match_parent"
android:text="verify"
android:layout_marginTop="10dp"
android:background="@android:color/holo_blue_dark"
android:layout_height="wrap_content" />
</LinearLayout>