ImageView - (Android Essentials: XML & Java)

  1. android:src: Specifies the image resource to be displayed in the ImageView. It can be set to a drawable resource or a URL.

  2. android:scaleType: Defines how the image should be scaled and displayed within the ImageView. Some common values are "centerCrop," "fitCenter," and "centerInside."

  3. android:adjustViewBounds: Indicates whether the ImageView should adjust its bounds to preserve the aspect ratio of the image.

  4. android:tint: Sets a color filter on the ImageView, applying a tint to the displayed image.

  5. android:alpha: Specifies the opacity of the ImageView. The value ranges from 0 (transparent) to 1 (opaque).

  6. android:background: Sets the background color or drawable for the ImageView.

  7. android:padding: Defines the padding around the content of the ImageView.

  8. android:cropToPadding: Specifies whether the padding of the ImageView should be included in the scaling of the displayed image.

<ImageView
    android:id="@+id/myImageView"
    android:layout_width="200dp"
    android:layout_height="200dp"
    android:src="@drawable/my_image"
    android:scaleType="centerCrop"
    android:adjustViewBounds="true"
    android:tint="@color/my_tint_color"
    android:alpha="0.8"
    android:background="@drawable/my_background"
    android:padding="8dp"
    android:cropToPadding="true" />