Simon Ics Date Picker Dialog throws android.view.InflateException: Binary XML file line #20: Error inflating class net.simonvt.widget.DatePicker

旧城冷巷雨未停 提交于 2019-12-03 20:21:09
ham

I ran into the same problem. The solution is to add three items to your style like in the DatePickerSamples:

<style name="SampleTheme" parent="@android:style/Theme">
    <item name="calendarViewStyle">@style/Widget.Holo.CalendarView</item>
    <item name="datePickerStyle">@style/Widget.Holo.DatePicker</item>
    <item name="numberPickerStyle">@style/NPWidget.Holo.NumberPicker</item>
</style>

Building on what @ham said,

after adding these lines as xml resources:

<style name="SampleTheme" parent="@android:style/Theme">
    <item name="calendarViewStyle">@style/Widget.Holo.CalendarView</item>
    <item name="datePickerStyle">@style/Widget.Holo.DatePicker</item>
    <item name="numberPickerStyle">@style/NPWidget.Holo.NumberPicker</item>
</style>

it is necessary to add this attribute to your application tag in AndroidManifest:

android:theme="@style/SampleTheme"

also do not miss :

<!-- Copy one of these attributes to your own theme (choose either dark or light).
    <item name="numberPickerStyle">@style/NPWidget.Holo.NumberPicker</item>
    <item name="numberPickerStyle">@style/NPWidget.Holo.Light.NumberPicker</item>
-->
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!