Android widget that displays an arbitrary image or drawable, such as an icon.
Questions tagged [imageview]
9865 questions
183
votes
19 answers
Adding gif image in an ImageView in android
I added an animated gif image in an imageView. I am not able to view it as a gif image. No animation is there. It's appearing just as a still image. I would like to know how can i show it as a gif image.

Kamalone
- 4,045
- 5
- 40
- 64
170
votes
3 answers
What's the difference between CENTER_INSIDE and FIT_CENTER scale types?
I can't tell the difference between ImageView.ScaleType.CENTER_INSIDE and ImageView.ScaleType.FIT_CENTER.
CENTER_INSIDE
Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be…

Keith
- 2,958
- 4
- 26
- 29
168
votes
2 answers
Resize image to full width and fixed height with Picasso
I have a vertical LinearLayout where one of the items is an ImageView loaded using Picasso. I need to rise the image's width to the full device width, and to display the center part of the image cropped by a fixed height (150dp). I currently have…

David Rabinowitz
- 29,904
- 14
- 93
- 125
164
votes
13 answers
Full screen background image in an activity
I see many applications that use a full-screen image as background.
This is an example:
I want to use this in a project, the best way I've found so far to do this is to use an image with a large size, put it in a ImageView and use android:…

Sergio76
- 3,835
- 16
- 61
- 88
157
votes
10 answers
Change Image of ImageView programmatically in Android
When I change the image programmatically, it shows new image on top of the old image which is set originally in layout file?
Here is a snippet of my layout file:

user1529412
- 3,616
- 7
- 26
- 42
156
votes
8 answers
Unwanted padding around an ImageView
I need to include a header graphic in all of my activities/views. The file with the header is called header.xml:

stefs
- 18,341
- 6
- 40
- 47
138
votes
4 answers
Remove the image from a imageview Android
I'm trying to make an ImageView that holds a gallery of images. By touching the user request to load the next image. If the next image isn't found in the server or takes time to load I need the old image to be empty.
setVisibility(View.GONE) or…

ChyBy
- 1,655
- 2
- 13
- 15
132
votes
10 answers
android: stretch image in imageview to fit screen
I have an imageview that has its height and width set to fill_parent with a linearlayout that has the same values set. So I suppose this should set my images to fit the screen. But it only fits like 80% (margin top and bottom in landscape…

Johan
- 2,149
- 4
- 21
- 18
123
votes
2 answers
Android imageview not respecting maxWidth?
So, I have an imageview that should display an arbitrary image, a profile picture downloaded from the internet. I want this the ImageView to scale its image to fit inside the height of the parent container, and a set max width of 60dip. However, if…

juell
- 4,930
- 4
- 18
- 19
116
votes
2 answers
Replace selector images programmatically
I have an ImageView that has a drawable image resource set to a selector. How do I programmatically access the selector and change the images of the highlighted and non-highlighted state?
Here is a code of selector:

dropsOfJupiter
- 6,763
- 12
- 47
- 59
115
votes
17 answers
Android: Generate random color on click?
I have an ImageView, in which I am programmaticly creating drawables and presenting them to the user. My goal is to click on said ImageView and change the drawable's color.
How would I go about the random color changing bit? I am currently tinkering…

Jared
- 4,823
- 6
- 23
- 15
113
votes
10 answers
android: create circular image with picasso
The question had been asked and there had been a promise made for the very version of Picasso that I am using: How do I send a circular bitmap to an ImageView using Picasso? I am new to Picasso and only thing I have used is…

Katedral Pillon
- 14,534
- 25
- 99
- 199
111
votes
12 answers
android - save image into gallery
i have an app with a gallery of images and i want that the user can save it into his own gallery.
I've created an option menu with a single voice "save" to allow that but the problem is...how can i save the image into the gallery?
this is my…

Christian Giupponi
- 7,408
- 11
- 68
- 113
110
votes
13 answers
Set visibility of progress bar gone on completion of image loading using Glide library
Hi I want to have a progress bar for image which will shown while image loading but when image loading will be completed I want to set it to gone. Earlier I was using Picasso library for this. But I don't know how to use it with Glide library. I…

Hari Ram
- 3,098
- 5
- 23
- 30
106
votes
8 answers
set height of imageview as matchparent programmatically
I need to set the height of an imageview as matchparent programatically.if it is a fixed height i know how to set.
but how can i set it as matchparent?
EDIT:
actually height of the parent layout is dynamic.so i need to make the height of the…

andro-girl
- 7,989
- 22
- 71
- 94