0

All of the image sizes are only below 150kb. I know is the resolution problem, but how can I solve it without changing the resolution? All of the images have different resolutions. The biggest one is 1800*1200 pixels, the smallest is 1109*614 pixels. I have tried the answer find at here. But it does not work.

This is the output interface.

This is my source code. I was cutting it to become shorter because the system does not allow me to post it in longer code.

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="top"
android:orientation="vertical"
>

<ScrollView

    android:fillViewport="true"
    android:id="@+id/scrollView1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <LinearLayout

        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="top"
        android:orientation="vertical"
       >

       <FrameLayout

            android:layout_width="match_parent"
            android:layout_height="wrap_content">



            <ImageView

                android:src="@drawable/back" />

            <TextView


                android:fontFamily="@font/im_fell_dw_pica_sc"/>

        </FrameLayout>

        <FrameLayout

            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <ImageView

                android:src="@drawable/abs3" />


            <TextView

                android:fontFamily="@font/im_fell_dw_pica_sc"/>

        </FrameLayout>

        <FrameLayout

            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <ImageView

                android:src="@drawable/leg" />


            <TextView
              />

        </FrameLayout>

        <FrameLayout

            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <ImageView

                android:src="@drawable/chest"
                />


            <TextView
               />

        </FrameLayout>


    </LinearLayout>
</ScrollView>

lionhau
  • 13
  • 4
  • Are you using any library for displaying the images? like Glide or Picasso? Also, these images are coming from a remote source like URL or locally stored? Please post your code. – Azhar92 Apr 27 '20 at 17:24
  • I have updated my XML code, please take a look. All of the pictures are locally stored. – lionhau Apr 27 '20 at 19:56
  • What is the resolution of the images in pixels? – Azhar92 Apr 27 '20 at 20:38
  • All of the images have different resolutions. The biggest one is 1800*1200 pixels, the smallest is 1109*614 pixels. – lionhau Apr 28 '20 at 06:52
  • You might try loading these images via a library like Glide instead of directly loading the images as in your case. They internally take care of a lot of memory/paging related stuff which can potentially fix the lag issue. – Azhar92 Apr 28 '20 at 07:29
  • Ok thanks for your help, I will learn it and try it. – lionhau Apr 28 '20 at 10:05

0 Answers0