Android widget that displays an arbitrary image or drawable, such as an icon.
Questions tagged [imageview]
9865 questions
24
votes
2 answers
What is the best way to display millions of images in Java?
You see that ?
Each brick of each house is an image of 16x16 pixels.
What you can see here a version based on simple JavaFX, with some Imageview moved on X and Y to give the effect of "construction".
I just adapt this to Swing using…

Mizur
- 470
- 4
- 17
24
votes
9 answers
How to set image in imageview in android?
I want to show an image in imageview so I made a folder - drawable in res and put my image there. Something like apple.png. Then I use this code:
ImageView iv= (ImageView)findViewById(R.id.img_selected_image);
String path =…

shadi
- 431
- 3
- 5
- 15
24
votes
7 answers
How to place an imageview on top of another imageview in android
This is my layout which i tried so far without any success

coderslay
- 13,960
- 31
- 73
- 121
23
votes
7 answers
how to get the source of ImageView in order to change it?
I know that changing the ImageView resource is not big deal just using myImageView.setImageResource(mynewImageDrawable)
but what I want to do is to check the current ImageSource before changing it.
basically, I want to implement my own group radio…

Red Sea
- 243
- 1
- 2
- 5
22
votes
3 answers
Change remoteView ImageView background
I have some remoteView with ImageViews, and I need to change the "android:background" programmatically.
I know how to change the "android:src" with:
remoteView.setImageViewResource(int viewId, int srcId);
And it works fine, but how do I change the…

BrainCrash
- 12,992
- 3
- 32
- 38
22
votes
4 answers
Does android:scaleType="fitCenter" only work with fix Layout_width and Layout_height attributes?
I use Layout_width="fill_parent" and Layout_height="wrap content". If an image is bigger than the ImageView, it will be downscaled perfectly.
However, I never got it working to upscale smaller images. I tried any combination of ScaleType and…

OneWorld
- 17,512
- 21
- 86
- 136
22
votes
5 answers
Repeat image horizontally and vertically
I want to repeat the following image:
to achieve the following background:
I tried a few codes as follow:
bluePatternView.backgroundColor = [UIColor colorWithPatternImage:
[[UIImage imageNamed:@"blue_pattern.png"]…

hasan
- 23,815
- 10
- 63
- 101
22
votes
4 answers
How set imageview scaletype to topCrop
I'm coding android and I have a imageview. I want to set scaletype of this to topcrop.
I could find centercrop in options, but it's not my request. How do I do?

Javad Abedi
- 396
- 1
- 3
- 11
22
votes
5 answers
Picasso java.lang.IllegalStateException: Method call should not happen from the main thread
I am attempting to use Picasso to get three Bitmap images from a URL
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.tab2);
Drawable d1 = new…

Brian
- 7,098
- 15
- 56
- 73
22
votes
4 answers
Android - ViewRootImpl$CalledFromWrongThreadException
I was using this, to DISPLAY IMAGES FROM THE INTERNET but it throws an error as below:
04-12 13:45:05.337: E/AndroidRuntime(27897): Caused by: android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view…

chinna_82
- 6,353
- 17
- 79
- 134
21
votes
6 answers
Double-tap to zoom and pinch to zoom on ImageView in android
I was looking for iphone like tap and pinch zooming with android ImageView. Mike Ortiz have done some excellent work on TouchImageView to detect boundaries. His code can be found here.
This code is missing only one thing, i.e., double-tap to zoom. …

Mazhar
- 366
- 1
- 2
- 13
21
votes
6 answers
Put a button over an ImageView
I'm newbie in Android.
I would like to know if it's possible to put a button or another component over an ImageView. I've tried setting the image as a background image of a LinearLayout, but when I change between landscape and portrait mode, the…

gutiory
- 1,135
- 5
- 13
- 33
21
votes
7 answers
Show AlertDialog with ImageView without any padding
EDIT - SOLUTION:
I ended up figuring out a way to solve this issue. Because manually changing the height of the ImageView removes the extra padding, I ended up finding the dimensions of the original image, and apply them to the ImageView once the…

AggieDev
- 5,015
- 9
- 26
- 48
21
votes
2 answers
Android Google Map to show as picture
I've implemented Google Maps V2 in my android app and now I would like to do something differently. I'm showing a location (longitude, latitude) with a marker. The problem is that this is showing in my activity as a Map. I would like to show it as a…

tzuvy
- 279
- 1
- 2
- 8
21
votes
3 answers
Transparent part of image in ImageView become black
I have problem when displaying image with transparency in Android KitKat (Nexus 7), it is OK in nexus 4 (KitKat) and other previous Android OS, here the image:
and ImageView…

hakim
- 3,819
- 3
- 21
- 25