新 android 版本中的旧样式搜索栏

Old style seekbar in new android versions

Type-1

类型 2

<SeekBar
                android:id="@+id/SeekBarTestPlay"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content" />

描述:

我所知道的

我正在尝试做什么

{编辑}

<SeekBar
                android:id="@+id/SeekBarTestPlay"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:theme="@android:style/Theme.NoTitleBar"/>

您可以为您的 SeekBar 指定一个 android:theme 属性,其样式将在支持它的所有 API 级别上显示。您想要的 type-1 主题称为 Theme.

android:theme="@android:style/Theme"

可以使用适当的 @android:style/Widget 样式应用姜饼小部件样式。

<SeekBar
    android:id="@+id/SeekBarTestPlay"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    style="@android:style/Widget.SeekBar" />

如果您想强制应用中的所有 SeekBar 看起来像姜饼搜索栏,您可以在主题中设置 android:seekBarStyle 属性。

<style name="AppTheme" ...>
    <item name="android:seekBarStyle">@android:style/Widget.SeekBar</item>
</style>

如果您希望您的整个应用看起来像姜饼,您可以设置您的应用主题以扩展基本主题。

<style name="AppTheme" parent="android:Theme">
    ...
</style>