Android ImageView

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Introduction

ImageView (android.widget.ImageView) is a View for displaying and manipulating image resources, such as Drawables and Bitmaps.

Some effects, discussed in this topic, can be applied to the image. The image source can be set in XML file (layout folder) or by programatically in Java code.

Syntax

  • The method setImageResource(int resId) sets a drawable as the content of this ImageView.
  • Usage: imageView.setImageResource(R.drawable.anyImage)

Parameters

ParameterDescription
resIdyour Image file name in the res folder (usually in drawable folder)


Got any Android Question?