Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/224.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 重复使用同一布局时显示错误图形的进度条_Java_Android_Progress Bar - Fatal编程技术网

Java 重复使用同一布局时显示错误图形的进度条

Java 重复使用同一布局时显示错误图形的进度条,java,android,progress-bar,Java,Android,Progress Bar,我有两个不同的活动,这两个活动都负责显示带有图像的列表视图。ListView是LazyLoader,在下载图像时,会显示一个progressbar。一旦图像显示,progressbar就会消失。两个活动使用相同的布局。我注意到,在第一个活动中,进度条按预期显示,呈半白色,但当第二个活动使用相同的布局时,进度条的颜色会发生变化,它会变成蓝色,看起来更像姜饼进度条。我没有在代码中更改progressbar的任何属性 布局文件: <LinearLayout xmlns:android="http

我有两个不同的活动,这两个活动都负责显示带有图像的列表视图。ListView是LazyLoader,在下载图像时,会显示一个progressbar。一旦图像显示,progressbar就会消失。两个活动使用相同的布局。我注意到,在第一个活动中,进度条按预期显示,呈半白色,但当第二个活动使用相同的布局时,进度条的颜色会发生变化,它会变成蓝色,看起来更像姜饼进度条。我没有在代码中更改progressbar的任何属性

布局文件

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/browse_list_row_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal" >

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

        <TextView
            android:id="@+id/titleText"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

    </LinearLayout>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" >

        <FrameLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="0dp"
            android:paddingBottom="16dp"
            android:layout_marginLeft="16dp"
            android:layout_marginTop="16dp" >

            <ProgressBar
                android:id="@+id/progressBar"
                android:layout_width="100dp"
                android:layout_height="100dp"
                android:layout_gravity="center"
                android:visibility="visible" />

            <ImageView
                android:id="@+id/profileImg"
                android:layout_width="100dp"
                android:layout_height="100dp"/>
        </FrameLayout>

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_marginLeft="16dp"
            android:layout_weight="1"
            android:gravity="center_vertical"
            android:orientation="vertical" >

            <TextView
                android:id="@+id/browseName"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="FirstName"
                android:textColor="#54575A"
                android:textSize="20sp" />

                 <TextView
                android:id="@+id/countryTxt"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Country"
                        android:textColor="#54575A"
                android:textSize="17sp" />

            <TextView
                android:id="@+id/ageText"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                   android:textColor="#54575A"
                android:text=""
                android:textSize="17sp" />


        </LinearLayout>

    </LinearLayout>

    </LinearLayout>

预期的第一个输出:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.test.student"
    android:versionCode="3"
    android:versionName="3.0" >

    <uses-sdk
        android:minSdkVersion="14"
        android:targetSdkVersion="20" />

    <!-- Require Internet state -->

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <!-- this is for college phone number -->
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <permission
        android:name="com.test.student.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />
    <application
        android:name="com.test.student.ParseApplication"
        android:allowBackup="true"
        android:hardwareAccelerated="true"
        android:icon="@drawable/app_icon"
        android:label="@string/app_name"
        android:largeHeap="false"
        android:theme="@style/testTheme" >
        <activity
            android:name="com.test.student.SplashScreenActivity"
            android:label="@string/app_name"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data
                    android:host="http"
                    android:scheme="student" />
            </intent-filter>
        </activity>

      <activity
            android:name="com.test.student.SearchSelection"
            android:label="@string/title_activity_search_selection"
            android:screenOrientation="portrait" >
        </activity>

        <activity
            android:name="newActivities.FindStudentBrowseStoryActivity"
            android:label="@string/title_activity_find_student_browse_story"
            android:screenOrientation="portrait" >
        </activity>
    </application>

    <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />

</manifest>

第二个不期望的输出:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.test.student"
    android:versionCode="3"
    android:versionName="3.0" >

    <uses-sdk
        android:minSdkVersion="14"
        android:targetSdkVersion="20" />

    <!-- Require Internet state -->

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <!-- this is for college phone number -->
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <permission
        android:name="com.test.student.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />
    <application
        android:name="com.test.student.ParseApplication"
        android:allowBackup="true"
        android:hardwareAccelerated="true"
        android:icon="@drawable/app_icon"
        android:label="@string/app_name"
        android:largeHeap="false"
        android:theme="@style/testTheme" >
        <activity
            android:name="com.test.student.SplashScreenActivity"
            android:label="@string/app_name"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data
                    android:host="http"
                    android:scheme="student" />
            </intent-filter>
        </activity>

      <activity
            android:name="com.test.student.SearchSelection"
            android:label="@string/title_activity_search_selection"
            android:screenOrientation="portrait" >
        </activity>

        <activity
            android:name="newActivities.FindStudentBrowseStoryActivity"
            android:label="@string/title_activity_find_student_browse_story"
            android:screenOrientation="portrait" >
        </activity>
    </application>

    <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />

</manifest>

清单声明:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.test.student"
    android:versionCode="3"
    android:versionName="3.0" >

    <uses-sdk
        android:minSdkVersion="14"
        android:targetSdkVersion="20" />

    <!-- Require Internet state -->

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <!-- this is for college phone number -->
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <permission
        android:name="com.test.student.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />
    <application
        android:name="com.test.student.ParseApplication"
        android:allowBackup="true"
        android:hardwareAccelerated="true"
        android:icon="@drawable/app_icon"
        android:label="@string/app_name"
        android:largeHeap="false"
        android:theme="@style/testTheme" >
        <activity
            android:name="com.test.student.SplashScreenActivity"
            android:label="@string/app_name"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data
                    android:host="http"
                    android:scheme="student" />
            </intent-filter>
        </activity>

      <activity
            android:name="com.test.student.SearchSelection"
            android:label="@string/title_activity_search_selection"
            android:screenOrientation="portrait" >
        </activity>

        <activity
            android:name="newActivities.FindStudentBrowseStoryActivity"
            android:label="@string/title_activity_find_student_browse_story"
            android:screenOrientation="portrait" >
        </activity>
    </application>

    <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />

</manifest>


我应该怎么做才能使第二个progressbar看起来像第一个?

您的两个活动是从同一个班级延伸出来的?并检查你的主题activities@Praveen它们中没有一个使用与默认主题不同的主题,并且导入看起来类似。您可以发布您的AndroidManifest.xml吗?@shhp请检查问题中添加的manifest这两个活动是否扩展了不同的类?