繁体   English   中英

Android Studio:在模拟器上测试时水平滚动视图冻结

[英]Android Studio: Horizontal Scroll View Freezes While Testing On Emulator

当我在我的模拟器上测试我的应用程序(具有水平滚动视图)时,滚动部分在中间冻结。 有时当我滚动另一个方向时滚动冻结。应用程序不会冻结,因为后退按钮工作。 这会冻结在一个真正的Android设备上,还是这只是我的模拟器反应?

这是我的滚动活动代码:

 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="namee.com.myapp.School"
android:background="#000000">

<HorizontalScrollView android:id="@+id/horizontalScroll"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:fadingEdgeLength="20dp"
    android:background="#000000">

   <LinearLayout
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:background="#000000">

       <ImageView android:src="@drawable/sunset3" android:layout_height="354dp" android:layout_width="600dp" />
       <ImageView android:src="@drawable/sunset3" android:layout_height="354dp" android:layout_width="600dp" />
       <ImageView android:src="@drawable/sunset3" android:layout_height="354dp" android:layout_width="600dp" />


       </LinearLayout>

</HorizontalScrollView>

这是sunset3

http://postimg.org/image/5l69hadel/

对我来说,关闭“使用主机GPU”功能解决了在模拟器中滚动时的冻结问题。

在我的情况下 - 垂直滚动条 - 它是API编号的问题。 使用主机GPU,RAM 512和VM堆32(也尝试256)在2个AVD上运行相同的程序。

API 21工作,API 19冻结。 增加VM堆并没有解决问题,但我确认禁用主机GPU工作(显然所有都变得非常慢)。

我在我的Android设备(三星Galaxy S4 mini,Android 4.4.2)上试过它,它运行正常。 这可能是仿真器的一些问题(例如内存限制太低)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM