When scrolling podlagivaet scrollview. How can this be fixed? Image size 1200x600

<android.support.percent.PercentRelativeLayout android:id="@+id/vkl3" android:visibility="visible" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/imgone"> <ScrollView app:layout_marginTopPercent="13%" app:layout_marginLeftPercent="5%" app:layout_widthPercent="36%" app:layout_heightPercent="80%" > <android.support.percent.PercentRelativeLayout android:visibility="visible" android:layout_width="match_parent" android:layout_height="match_parent" > <ImageView app:layout_aspectRatio="48%" app:layout_widthPercent="100%" android:src="@drawable/imgforthird"/> </android.support.percent.PercentRelativeLayout> </ScrollView> </android.support.percent.PercentRelativeLayout> 

    1 answer 1

    This is due to the size of the image and due to processing it mainly in the UI stream. The solution is to reduce the picture and / or display it asynchronously.

    The latter can be done using either to display images - UIL or Picasso.

    • Unfortunately, Picasso cannot cope with such a problem, I compressed the image to a more acceptable quality. - Evgeny Suetin
    • @YevgeniySuyetin, I didn’t quite understand what you mean, but after I displayed the pictures as UIL, lags in ScrollView disappeared. - Yuriy SPb ♦
    • Unfortunately, when there was a picture of good quality, then the lags did not disappear, the amount of allocated RAM was about 200mb and it saw 1 picture on the screen - Evgeny Suetin
    • @ YevgenySuyetin, what if UIL is th? .. Are you talking about Picasso? - Yuriy SPb ♦
    • When I started using UIL, I had already applied compression, so it wasn’t possible to check. - Eugene Suetin