An example of Android imitating IOS digital password unlocking interface

As follows:

As every Android Developer knows, the most common way to unlock Android is to unlock Jiugongge, and the common way to unlock IOS is to unlock with digital password. In our development projects, we often need to combine Android and IOS. Sometimes we need to make our unlocking interface like an IOS digital keyboard.

Here I implemented a digital password unlocking interface modeled on IOS. Here I use two ways to implement it. The first is to use the form of custom controls, and the second is to use our layout. Here I will focus on the idea of using custom control form. As for the implementation method of using layout files, I won't explain it in detail. Specifically, I will upload the source code for you to download for research and learning.

Of course, my ability is limited. Maybe you think my way is bad, so you can put it forward to me and see how you think it can be realized. Let's study together.

OK, no more nonsense. Now let's explain the implementation method of the custom control I use:

1. The most important thing is to implement a custom numeric keypad (a custom view control):

1. Draw numbers

2. After drawing the numbers, we need to add a layer of circle outside each number to draw the circle

3. After clicking the number, we give a different effect to let the user know that he has clicked the number. Here, I am right. The color of the outer circle is changed to yellow

4. Finally, judge the number clicked

Well, maybe that's what I have. Incidentally, the above four controls for displaying passwords also adopt the method of custom controls. Threads are used to replace the entered numbers with password characters one second after entering numbers. (some people may say that the EditText control of the system can also be set as password. What I want to say here is, no, at least I can't try.)

The above example of Android imitation IOS digital password unlocking interface is all the content shared by Xiaobian. I hope it can give you a reference and support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>