我有一个正在生产中的应用程序,但一些用户报告我的一个活动中的背景没有加载,我猜这是由于在某些手机中呈现应用程序期间内存不足。
app的结构是这样的:
有一个ViewPager
内部有一个活动,ViewPager 的每个页面都是一个具有以下布局的片段,我的问题是没有加载背景,android:background="@drawable/bg_back_port"
没有在某些电话中加载。背景是一个.jpg
大小为 23KB、分辨率为800x1023
.
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<!-- The main content view -->
<FrameLayout
android:background="@drawable/bg_back_port"
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ScrollView
android:id="@+id/contentView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/titleBar"
android:fillViewport="true" >
<!--android:background="@drawable/bg_inside_port"-->
<LinearLayout
android:id="@+id/linearLayoutRoot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="20dp"
tools:context=".ActivityDisplayPage" >
</LinearLayout>
</ScrollView>
<ProgressBar
android:id="@+id/progressBar1"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:visibility="gone" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imvStarred"
android:src="@drawable/paper_locked"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true" />
</RelativeLayout>
</FrameLayout>
<!-- The navigation drawer -->
<ListView
android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#F0999999"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:paddingBottom="10dp" />
</android.support.v4.widget.DrawerLayout>
</RelativeLayout>
我无法模拟情况,我不确定为什么某些手机上不显示背景。
我确实对模拟器应用了不同的约束,但是这种情况并没有出现,所以我可以修复这个错误。
是否有任何方法可以模拟这种情况或在模拟器或测试环境中强制应用程序内存不足?