Android implementation of IOS wheel selection control instance (source download)

An example of IOS wheel selection control implemented by Android

Recently, according to the needs of the project, I sorted out a relatively comprehensive wheelview use control. To borrow a sentence I saw before, I stood on the shoulders of giants and made some small adjustments.

Paste the effect picture here first

The commonly used time selection format, single item selection, and city linkage can be basically met here.

Here, the single item selection and date time selection are proposed to the util class. The code is as follows:

Single choice

Here is the string type in the form of simulated incoming ArrayList:

Add: in our actual project, the usage may be to pass in an entity object, so we can find the method to set the display content in wheelview:

According to the above code, you can see that if it is an entity object, the display content is the return value of a method named getpickerviewtext (static constant = "getpickerviewtext") defined inside the object,

Therefore, when creating an object, pay attention to adding a getpickerviewext() method inside the object. The code is as follows:

Date selection

Here, you can directly get the desired result by selecting the date type and callback time format,

Condition selection

That's all for basic use. There's no technical content. It's just sorted out as a common tool. I hope it can bring convenience to everyone.

Thank you for providing the source code of this component.

Demo address

Thank you for reading, hope to help you, thank you for your support to this site!

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
分享
二维码
< <上一篇
下一篇>>