Questions tagged [imageview]

Android widget that displays an arbitrary image or drawable, such as an icon.

9865 questions
37
votes
4 answers

Android image view matrix scale + translate

I am trying to manually get an image inside an imageview centered and fitting the screen. I need to do it with a matrix (I will later dynamically change the matrix transformation). Problem is I can't get the image centered in the view (scale is…
Vincent Mimoun-Prat
  • 28,208
  • 16
  • 81
  • 124
37
votes
3 answers

How do I make my ImageView a fixed size regardless of the size of the bitmap

So I'm loading images from a web service, but the size of the images are sometimes smaller or bigger than other images and the visualization looks silly when I put them in a ListView in android. I'd like to fix the size of my ImageView so that it…
chubbsondubs
  • 37,646
  • 24
  • 106
  • 138
37
votes
1 answer

Set image from android.R.drawable in image view android

i know how to set image/icon from our res/drawable If we set it directly from…
user430926
  • 4,017
  • 13
  • 53
  • 77
37
votes
2 answers

Displaying emoticons in Android

My IM app has to support emoticons. They are GIFs and have textual representations, which are used in the input box if the user selects one of them. But I'd like to display them as images after they have been sent.Currently my custom array adapter…
Diepie
  • 772
  • 1
  • 8
  • 15
36
votes
4 answers

How to set an imageView's image from a string?

I have a list of entries and some bitmap files in the res/drawable-mdpi directory. I'm trying to load the image corresponding to the string value selected from the list by generating a path string and using bitmap factory. The problem is I don't…
Matt
  • 2,650
  • 4
  • 36
  • 46
36
votes
8 answers

android:load svg file from web and show it on image view

I want to load a svg file from the web and show this file in an ImageView. For non vector images I use the Picasso library. Is it possible to use this library for svg files as well? Is there any way to load svg files from the web and show it in an…
mahdi
  • 16,257
  • 15
  • 52
  • 73
36
votes
17 answers

ImageView rounded corners

I wanted image to have rounded corners. I implement this xml code and use this in my image view. but image overlap the shape. I am downloading the image through async task.
FIXI
  • 920
  • 2
  • 10
  • 18
36
votes
4 answers

Deep copy of a Drawable

I have an ImageView. In its onClick I get its Drawable: Drawable dr = ((ImageView) v).getDrawable(); And set it to a dialog's ImageView: zoomedImage.setImageDrawable(dr); But when I close the dialog or the activity is resumed. The image at the…
Shashank Degloorkar
  • 3,151
  • 4
  • 32
  • 50
35
votes
4 answers

Why are there extra pixels around my Android GridView?

I have a GridView in my Android application that has a number of ImageViews in it. The space on my screen is limited and I want the images to take up as much of the available space as they can. Unfortunately, the GridView always leaves 5 pixels of…
A.J.
  • 1,550
  • 2
  • 14
  • 18
34
votes
5 answers

How to show image using ImageView in Android

I am looking for the way to assign image src to image view control. I read few example and they says something src="@drawable\image" but didn't understand this, also I want to assign image src at runtime by java code also want to apply default…
BreakHead
  • 10,480
  • 36
  • 112
  • 165
34
votes
5 answers

Android: OutofMemoryError: bitmap size exceeds VM budget with no reason I can see

I am having an OutOfMemory exception with a gallery over 600x800 pixels JPEG's. The environment I've been using Gallery with JPG images around 600x800 pixels. Since my content may be a bit more complex than just images, I have set each view to be a…
Meymann
  • 2,520
  • 2
  • 28
  • 22
34
votes
3 answers

Strange behaviour of images in RecyclerView

I am using android.support.v7.widget.RecyclerView to show simple items containing text and in some cases also images. Basically I followed the tutorial from here https://developer.android.com/training/material/lists-cards.html and just changed the…
34
votes
11 answers

Mask ImageView with round corner background

I am having a Custom ListView which contains an ImageView and TextView. Everything is working fine. What I want is the image is displayed in list are in round corner. From the Webservice i get the images in rectangle shape. But i want to display it…
GrIsHu
  • 29,068
  • 10
  • 64
  • 102
34
votes
6 answers

IllegalArgumentException: width and height must be > 0 while loading Bitmap from View

I'm trying to draw on an ImageViewTouch, a library which enables pinch zooming. I'm able to draw over the image using Canvas, but when I zoom the image, the drawing disappears. For this, I'm trying to convert the view to a bitmap and set…
Felipe Mosso
  • 3,907
  • 11
  • 38
  • 61
32
votes
4 answers

How to create an ImageView that fills the parent height and displays an Image as big as possible?

I have an ImageView that is defined in the following way:
Janusz
  • 187,060
  • 113
  • 301
  • 369