【发布时间】:2013-08-01 14:37:36
【问题描述】:
我在将按钮样式应用到主题时遇到问题,但直接应用到按钮效果很好。知道这里有什么问题吗?
themes.xml
<style name="Theme.AppTheme" parent="@style/Theme.Sherlock.Light.DarkActionBar">
<item name="android:buttonStyle">@style/ButtonAppTheme</item>
</style>
styles.xml
<style name="ButtonAppTheme" parent="@android:style/Widget.Button">
<item name="android:background">@drawable/btn_default_holo_light</item>
<item name="android:minHeight">48dip</item>
<item name="android:minWidth">64dip</item>
<item name="android:textColor">#000000</item>
</style>
AndroidManifest.xml
<Application
android:name=".ThreesixtyusApp"
android:allowBackup="true"
android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@style/Theme.AppTheme" >
直接应用按钮样式有效:
<Button
android:id="@+id/like"
android:layout_width="100dp"
android:layout_height="wrap_content"
style="@style/ButtonAppTheme"
android:text="@string/like" />
【问题讨论】:
-
可能是活动具有属性“主题”并且它覆盖了应用程序主题?
-
这看起来是生成的。您是否忘记了 values-v11 或 values-v14 文件夹中的样式/主题?
-
@Krylez 谢谢!解决了问题,您应该将其发布为答案吗?
标签: android android-theme