简体   繁体   English

ios 喜欢 android 平台的日期/时间选择器

[英]ios like date/time picker for android platform

I'm building mobile app for both ios and android platform using native ios/android code.我正在使用本机 ios/android 代码为 ios 和 android 平台构建移动应用程序。 And I want apps looks similar.我希望应用程序看起来相似。 So I need ios style picker (for date and time selection) available in android. I spend half of the day but don't find any sutable variant.所以我需要 android 中的 ios 样式选择器(用于日期和时间选择)。我花了半天时间,但没有找到任何合适的变体。 Will be more than happy if you suggest something.如果您提出建议,我们将非常高兴。 I think there should be variants, because I saw several android apps where picker looks the same as on ios (anydo for example).我认为应该有变体,因为我看到几个 android 应用程序,其中选择器看起来与 ios 上的相同(例如 anydo)。

What I already checked:我已经检查过的内容:

  1. android-spinnerwheel (abandoned, not sutable for using, require build actual picker from it's comp.net, so quite a lot of code) android-spinnerwheel (已废弃,不适合使用,需要从它的 comp.net 构建实际的选择器,所以代码很多)

  2. wheelpicker (quality unclear, regional standards/datetime constants hardcoded in code and in general control hard to customize, however it's candidate for forking and fixing things manually. For sure it's not supporting am-pm/24h UI switching) wheelpicker (质量不明确,区域标准/日期时间常量硬编码在代码中,一般控制难以定制,但它是手动分叉和修复的候选者。肯定它不支持 am-pm/24h UI 切换)

  3. PickView (no layout, implemented as dialog, poore customization abilities) PickView (无布局,作为对话框实现,自定义能力差)

  4. CharacterPickerView (do not use default layout settings, hard to customize without fixing sources, hardcoded values, GPL license) CharacterPickerView (不要使用默认布局设置,如果不固定源就很难自定义,硬编码值,GPL 许可证)

PS I will cosinder payed variants if they exists.附注:如果存在付费变体,我将与他们合作。


After investigation we ended up with custom controls build based on wheelpicker经过调查,我们最终得到了基于wheelpicker的自定义控件构建

You can Use wheel type effect in android here is code:您可以在 android 中使用轮式效果,这里是代码:

<DatePicker
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:calendarViewShown="false"
   android:datePickerMode="spinner"/>

You can Use wheel type effect in android here is code:您可以在 android 中使用轮子类型效果这里是代码:

https://github.com/ayushhgoyal/AyushWheel/ https://github.com/ayushhgoyal/AyushWheel/

Hope this will Help !希望这会有所帮助! Cheers !干杯!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM