如何制作自定义输入pin码Android?

问题描述 投票:0回答:1

我在 Kotlin Android 上制作项目。我怎样才能使相同的字段和相同的输入?在我看来,创建一些编辑文本并不是一个好的决定 enter image description here

enter image description here

现在我有了这个决定

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="24dp"
        android:layout_marginStart="16dp"
        android:layout_marginEnd="16dp"
        android:hint="_ _ _ _ _ _"
        android:paddingTop="10dp"
        android:paddingBottom="10dp"
        android:textSize="14sp"
        android:fontFamily="@font/stolzl_regular"
        android:gravity="center"
        android:inputType="number"
        android:letterSpacing="0.12"
        android:maxLength="6"
        android:background="@drawable/custom_input_number"/>

但我怎么注意却不起作用

android android-edittext android-theme android-styles
1个回答
0
投票

您需要研究一个可以为您完成这项工作的图书馆的市场。 AndroidArsenalgithub.com 是不错的起点。

如果您在一两个小时内找不到好的库,您将不得不实现一个自定义组件。 Android 有一个很好的文档告诉你如何做this

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