1

This is the xml code. which is the best way to show low quality image in background given view?

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

         <View
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@drawable/lowest_quality_image"/>

         <ImageView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@drawable/lowest_quality_image"/>

         <AppCompatImageView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@drawable/lowest_quality_image"/>

</LinearLayout>
Vidhi Dave
  • 5,614
  • 2
  • 33
  • 55
  • refer this post: [Android background image memory usage](https://stackoverflow.com/questions/13118005/android-background-image-memory-usage) – Gokul Gowda Mar 09 '18 at 08:56

1 Answers1

0

All variants are same because you use background tag.

With image view you should use android:src for usual drawable or app:srcCompat for vector drawable. Also you can scale by scaleType.

ImageView vs AppCompatImageView:

The second one has backports for some features from new Apis.

Ivan Shafran
  • 591
  • 2
  • 17