如何获得标准的Android 4.1 ProgressBar布局?

时间:2014-06-27 16:09:33

标签: java android

我只是想知道,为什么我没有得到标准的Android 4.1 ProgressBar布局。在我的AndroidManifest.xml中,我定义了

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="de.wucop.quiz3"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="16"
        android:targetSdkVersion="19" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_icon"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.Light.NoTitleBar" >

    ...

</manifest>

和ProgressBar一样

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/transparent_sq_white" >

    ...

    <ProgressBar
        android:id="@+id/pb_list_item_level"
        style="?android:attr/progressBarStyleHorizontal"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/tv_list_item_level_title"
        android:layout_alignRight="@+id/iv_list_item_go"
        android:layout_below="@+id/tv_list_item_level_title"
        android:max="100" />

</RelativeLayout>

但我只是采用Android 2.3.3布局(http://p07.imgup.net/Screenshotafb3.png)。

我做错了什么?谢谢你的帮助!

1 个答案:

答案 0 :(得分:0)

您已经明确告诉Android使用前Holo主题(Theme.Light.NoTitleBar)。如果您想使用全息小部件主题,则需要在API级别11 +上使用以Theme.Holo为根的内容。