【发布时间】:2016-08-12 14:07:50
【问题描述】:
滚动视图中的大背景图像显然非常滞后,我尝试压缩图像,但这似乎并没有改变任何东西。有什么办法可以减少滚动延迟?任何答案都非常感谢,谢谢!
这是我的 XML 布局...
<HorizontalScrollView
android:overScrollMode="never"
android:id="@+id/day_switcher"
android:scrollbars="none"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:overScrollMode="never"
android:scrollbars="none"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RelativeLayout
android:id="@+id/day_holder"
android:layout_width="8000dp"
android:layout_height="wrap_content">
<RelativeLayout // Has Large Background Image
android:id="@+id/day_left"
android:background="some_background"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<include
layout="@layout/day_view_1" />
</RelativeLayout>
<RelativeLayout // Has Large Background Image
android:layout_toRightOf="@id/day_left"
android:background="some_background"
android:id="@+id/day_mid"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<include
layout="@layout/day_view_2" />
</RelativeLayout>
<RelativeLayout // Has Large Background Image
android:id="@+id/day_right"
android:background="some_background"
android:layout_toRightOf="@id/day_mid"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<include
layout="@layout/day_view_3" />
</RelativeLayout>
</RelativeLayout>
</ScrollView>
</HorizontalScrollView>
【问题讨论】:
-
首先:图片的分辨率是多少?
-
尝试减少您的视图层次结构。太乱了
-
@BartekLipinski 我猜是 1080 乘以 3000
-
你试过这个没有图片的xml吗?也许你的问题不是图片。
-
@invisbo 不,没有图像它可以正常工作。它也适用于 1 个背景图像,但不是全部 3 个
标签: android android-layout android-studio