很简单,修改styles.xml代码
<style name="AppBaseTheme" parent="android:Theme.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
为:
<style name="AppBaseTheme" parent="android:Theme.Holo.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
然后
AndroidManifest.xml文件中设置android:theme="@style/AppTheme"
<application
android:name=".AppContext"
android:allowBackup="true"
android:icon="@drawable/logo"
android:label="@string/app_name"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@style/AppTheme" >
</application>
运行程序可观察前后对比效果
本文介绍了如何将Android原生时间选择器的样式更改为滚轮样式。主要步骤包括在styles.xml文件中创建自定义主题,继承自`android:Theme.Holo.Light`,并在`AndroidManifest.xml`中将应用的主题设置为新建的主题`AppTheme`。通过这个方法,可以实现时间选择器的视觉效果变化。

2158

被折叠的 条评论
为什么被折叠?



