Titanium Android:calendarViewShown 不工作 Android 5.x 及更高版本

Titanium Android : calendarViewShown not working Android 5.x and later

我一直在尝试 Android 中的日期选择器,它工作得很好,我的问题是 calendarViewShown 属性。我需要在 android 的所有版本中使用旧式日期选择器,这在 android 4 及更低版本中默认使用,但是当我们 运行 android 5 上的应用程序时后来默认日期选择器显示日历,相反我想使用旧的日期选择器。 为此,我使用了 属性 calendarViewShown,如下图所示,我没有得到预期的结果。

<Alloy>
<Window class="container">
<View backgroundColor="black" height="Ti.UI.SIZE" width="Ti.UI.SIZE">
<Picker calendarViewShown="false" nativeSpinner="true" type="Ti.UI.PICKER_TYPE_DATE" datePickerMode="spinner"></Picker>
</View>
</Window>
</Alloy>

我终于找到了解决此问题的方法,我们必须将主题与选择器结合使用才能使用默认日期选择器。看看下面的代码:

**** xml 代码 ****

<Alloy>
    <Window id="win" title="" backgroundColor="transparent">
        <View height="100%" width="100%" backgroundColor="transparent" id="backView"></View>
        <View height="Ti.UI.SIZE" layout="vertical" backgroundColor="#f2f2f2" width="90%">
            <Label id="currentDate" top="10" color="#000" bottom="10" left="20"></Label>
            <View height="1" left="0" right="0" backgroundColor="#d9d9d9"></View>
            <View id="pickerView" height="Ti.UI.SIZE"></View>
            <Picker calendarViewShown="false" nativeSpinner="true" type="Ti.UI.PICKER_TYPE_DATE" backgroundColor="#f2f2f2" id="androidPicker" width="Ti.UI.FILL"></Picker>
            <View height="1" left="0" right="0" backgroundColor="#d9d9d9"></View>
            <View height="40dp">
                <View height="40dp" width="50%">
                <Label id="cancelButton" color="#000" right="20dp" onClick="closeWindow">Cancel</Label>
                </View>
                <View height="40dp" width="50%">
                    <Label id="doneButton" color="#000" onClick="getDatePicker">Done</Label>
                </View>
            </View>
        </View>
    </Window>
</Alloy>

在 platfrom 的主题文件中粘贴下面的样式 >> custometheme.xml

**** 主题 ****

<style name="Theme.Transparent" parent="@android:style/Theme.Holo.Light.Dialog">
    <item name="android:windowIsTranslucent">true</item>
    <item name="android:windowBackground">@android:color/transparent</item>
    <item name="android:windowContentOverlay">@null</item>
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowIsFloating">true</item>
    <item name="android:backgroundDimEnabled">true</item>
</style>

希望它也适用于其他人。