Android widget that displays an arbitrary image or drawable, such as an icon.
Questions tagged [imageview]
9865 questions
19
votes
1 answer
How to align TextView around an ImageView?
I am trying to align the TextView around ImageView. I am using the following code:
private void createSpannableText(){
TextView myTextView = (TextView) findViewById(R.id.textView);
SpannableStringBuilder builder = new…

Debopam Mitra
- 1,842
- 4
- 27
- 51
18
votes
1 answer
ImageView with rounded corners and inner shadow
I need to make a thumbnail view with rounded corners and inner shadow. Usually I'm making ImageView frames with 9patches, which have served me well so far, but this time the effect I need requires drawing the inner shadow on top of the image (and…

eeVoskos
- 501
- 2
- 5
- 16
18
votes
2 answers
How to make an Image as large as possible while maintaining aspect ratio
I have an image which is smaller than the container I would like it to fit inside of. I would like the image to stretch, keeping it's aspect ratio, to it's largest possible size.
To illustrate this problem:

Graeme
- 25,714
- 24
- 124
- 186
18
votes
3 answers
Android: how to detect touch location on ImageView if the image view is scaled by matrix?
I set OnTouchListener of an ImageView and implement onTouch method, but if the image is scaled using matrix, how do I calculate the location of the touch?
Or does the motion event automatically takes that into account when returning getX() and…

Heuristic
- 5,087
- 9
- 54
- 94
18
votes
7 answers
Add semi-transparent overlay on imageview
How can I add semi-transparent overlay on imageview?
change it to

Android Guy
- 573
- 1
- 8
- 18
18
votes
7 answers
Android : ImageView getID(); returning integer
I've set up an onTouch class to determine when one of my 40 buttons is pressed.
The problem I am facing is determining which button was pressed.
If I use:
int ID = iv.getId();
When I click on button "widgetA1"
I receive the following…

rick
- 181
- 1
- 1
- 3
18
votes
18 answers
Android Picasso Image does not load
There are two situations I load images, first, just directly from the internet, and second, load images that are downloaded in the device. And whenever I load, 8~9 out of 10 images are shown, and 1-2 missing. I see that decode returned false, and…

xosuma
- 267
- 1
- 3
- 11
18
votes
3 answers
Android: loading WebView output into App Widget
Whilst I appreciate that an App Widget does not support a WebView directly, is it at all possible to use an ImageView (which is supported), and a technique like described here to generate the image for the ImageView? The WebView wouldn't be used…

drmrbrewer
- 11,491
- 21
- 85
- 181
18
votes
10 answers
How to center ImageView in a toolbar?
Been trying to center a logo inside my toolbar. When i navigate to the next activity, the "up affordance" icon is present, and it will push my logo slightly to the right. How can I keep my logo at the center of the toolbar, without removing the up…

Spike Flail
- 683
- 3
- 8
- 17
18
votes
4 answers
Stretch image in ImageView
I have an ImageView that has its height and width set to "fill_parent" with a Relative Layout that has the same values set.Set Image scaleType="fitXY"
Here The XML layout:

developer
- 437
- 2
- 5
- 12
18
votes
1 answer
"The type Gallery is deprecated", Whats the best alternative?
I was really surprised that such a Widget gets deprecated.
I want a simple gallery that scrolls left and right, shows a picture on the whole Activity screen, and most important is that you cant swipe more than 1 image in any direction, even if the…

Omar
- 7,835
- 14
- 62
- 108
18
votes
7 answers
How to get the width and height of an Image View in android?
In my code I have an Image View in my XML layout and I keep changing the source image for this in my code. Now I want to know the width and height of the generated image each time.
I tried using getWidth(), getHeight(), getMeasuredWidth(), and …

Ankit
- 4,426
- 7
- 45
- 62
17
votes
2 answers
Android ImageViewer class supporting Pinch-Zoom and Scrolling
I am searching an ImageViewer library that opens an image in my application for a given URI (the image fetched by a webservice is already stored within my application in a secured place). I really like the "Samsung Galaxy S" ImageViewer-Activity…

tim.kaufner
- 1,247
- 5
- 13
- 22
17
votes
3 answers
How to get video thumbnail from YouTube URL and set it to image view in android
I want to create an application in which I want to play YouTube video. I want to get thumbnail from YouTube video URL which I have currently play in application and set it to image view. can any body help me with this.

Muhammad zubair
- 251
- 1
- 3
- 13
17
votes
3 answers
Constraint layout not showing image from ImageView when app run
I am trying to add some Images by ImageView in Android Activity(ConstraintLayout),
on Android Studio Preview screen, it's showing images correctly, but when I am running the app on real device or emulator, it's not showing the image.
Below is the…

vChamps
- 963
- 2
- 7
- 14