我正在使用AppCompat和设计库开发Android 4.0+应用程序。 Android 5.0上的一切看起来都很好。但在Android 4.0上,我看到了旧的进度条样式。
Xml布局:
<FrameLayout
android:background="@color/colorPrimary"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<SeekBar
android:id="@+id/play_seek_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</FrameLayout>
样式:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppBaseTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
</style>
<style name="ActionBarTheme" parent="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<item name="colorControlActivated">#fff</item>
</style>
</resources>
活动声明:
<activity android:name=".ui.PlayListsActivity"
android:launchMode= "singleInstance"
android:screenOrientation="portrait"
android:theme="@style/AppBaseTheme"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
答案 0 :(得分:2)
v7 appcompat库的23.1.0版添加了材料设计Seekbar
,您可以在changelog中看到。
您可能正在使用旧版本的v7 appcompat库。更新到上一个版本,SeekBar
将自动以其他小部件的材料设计样式为主题。
更改应用build.gradle
的相关性:
dependencies {
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
...
}
这些是在Android 4.4上获得的结果。
答案 1 :(得分:0)