【发布时间】:2014-01-10 13:40:10
【问题描述】:
我有一个在 ViewPager 中显示照片的照片库。
详细布局具有深色背景,并包含一个 ProgressBar,当图像完全下载时我会隐藏它。在我的 Nexus Android 4.4 上运行良好。
在 HTC Desire Android 2.2 上,无法在深色背景下看到 ProgressBar,但如果我将 ProgressBar 本身的背景设置为白色,我可以看到它正确显示和隐藏。在其他背景为白色的布局中也能正常显示。
如何让 ProgressBar 在 2.2 的深色背景中显示?
这是我的布局;
photo_detail_pager.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</LinearLayout>
photo_detail.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/background_dark">
<ProgressBar
android:id="@+id/loader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
/>
<ImageView
android:id="@+id/photo"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</RelativeLayout>
【问题讨论】:
标签: android