我想设置光环主题。数字选择器和呈现它的活动具有不同的主题。我在xml属性中完成了这个,并给出了光环主题的数字选择器。但它没有用。请帮帮....
我.... style.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Animations" />
<style name="Animations.GrowFromBottom">
<item name="@android:windowEnterAnimation">@anim/grow_from_bottom</item>
<item name="@android:windowExitAnimation">@anim/shrink_from_top</item>
</style>
<style name="Animations.GrowFromTop">
<item name="@android:windowEnterAnimation">@anim/grow_from_top</item>
<item name="@android:windowExitAnimation">@anim/shrink_from_bottom</item>
</style>
<style name="Animations.PopDownMenu">
<item name="@android:windowEnterAnimation">@anim/grow_from_topleft_to_bottomright</item>
<item name="@android:windowExitAnimation">@anim/shrink_from_bottomright_to_topleft</item>
</style>
<style name="AndroDev" parent="@android:style/Theme.Holo.Light"></style>
</resources>
我的清单文件......
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tablet"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="11" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:label="@string/app_name"
android:name=".SonyTabletActivity"
android:theme="@android:style/Theme.Black.NoTitleBar" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
我的xml ....
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<NumberPicker
android:id="@+id/numberPicker"
style="@style/AndroDev"
android:layout_width="100dp"
android:layout_height="100dp"
android:background="#ffffff"
android:orientation="horizontal" />
</LinearLayout>
答案 0 :(得分:0)
android:theme="@android:style/Theme.Holo.Light"
super.setTheme(android.R.style.Theme.Holo.Light)
通过res / values / style.xml创建自定义样式。
<?xml version.....>
<resources>
<style name="AndroDev" parent="@android:style/Theme.Holo.Light">
<item name="android:background">#ffffff</item>
</style>
</resources>
然后在xml中使用它,其中定义了数字选择器视图:
<NumberPickerView style:"@style/AndroDev" ....>
我举了Holo.Light主题的例子。你可以改变你想要的任何东西。