Questions tagged [imageview]

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

9865 questions
21
votes
5 answers

Padding in ImageView is not Working

I want to make a screen which contains a top bar and an image. I use TextView for the top bar and ImageView for the image. I want to set padding only to the image view. My xml is given below. The padding action is not working. Can anybody explain…
CrazyLearner
  • 782
  • 3
  • 11
  • 28
20
votes
6 answers

selector not working with layout and image view

I want to use selector for a layout and image view..But it is not working for me. When I changed image view to imagebutton or button, it works fine. Any help will be greatly appreciated.. Thanks in advance.. here is the xmls I used..
subair_a
  • 1,028
  • 2
  • 14
  • 19
20
votes
2 answers

Unexplained gap/padding to the left, between Toolbar, and LinearLayout

I have the following structure in the layout file of my Android studio project, and I see unexplained left padding between the parent element (Toolbar) and it's immediate child element (LinearLayout). Layout Text
20
votes
3 answers

How to insert drawables in text

I want to insert small pictures, like arrow icons for example, into certain positions of contents of a TextView. The photo below depicts exactly what I want: Obviously, the most naive solution is to use multiple TextView on either side of the small…
Behnam
  • 6,510
  • 6
  • 35
  • 65
20
votes
5 answers

Android add arrow image to spinner

I have created a background drawable that I use for a spinner. I would like to now but an arrow image inside this background. I have tried things like android:drawableRight="arrowimage", but this does not seem to show anything. Does anyone know how…
user3781214
  • 357
  • 1
  • 3
  • 16
20
votes
8 answers

How to display .gif file in imageview?

My layout have lots of imageviews. I want to show .gif animated file in just one imageview. I tried Yash method (Adding gif image in an ImageView in android) but .gif file shown all layout. Other views dissappeared. I want to show all. Any idea?
Breed Hansen
  • 1,159
  • 5
  • 13
  • 21
20
votes
2 answers

ImageView fit without stretching the image

is it possible that my ImageView will fit to all screen sizes without the image look stretched? i tried all scale types changing it to background and src with fill_parent > wrap_content but still. if the image is not smaller it just looks…
NoobMe
  • 544
  • 2
  • 6
  • 26
20
votes
4 answers

Android ImageView ScaleType and item height

Things looked quite simple first but in the end the result is not good. I have an image which has a width larger than screen's width. So I need to scale it down in my imageview. I looked over the ScaleType options and tried them all but none is ok.…
Alin
  • 14,809
  • 40
  • 129
  • 218
19
votes
2 answers

How do you change the size of an ImageView?

I have setup my ImageView like the following:
atedja
  • 1,436
  • 2
  • 11
  • 13
19
votes
4 answers

android - how to get the image edge x/y position inside imageview

If i have an ImageView that fills the screen. The ImageView background is set to green color. I place a bitmap in the ImageView, keeping bitmap proportions. A portrait photo in this layout will show green on both left and right side (Phone…
Erik
  • 5,039
  • 10
  • 63
  • 119
19
votes
4 answers

Setting Android images from string value

Currently I'm drawing a PNG image in my Android application like so: ImageView image = new ImageView(context); image.setImageDrawable(context.getResources().getDrawable(R.drawable.testimage)) If I have a list of image names in a database, is there…
ingh.am
  • 25,981
  • 43
  • 130
  • 177
19
votes
4 answers

Android ScrollView adds extra padding on top and bottom of child imageview

I have a problem with rendering a ScrollView. Essentially, the layout is fixed header and footer with a scrollview in the middle. The idea is that when the screen keyboard is activated for the content EditText the image can be scrolled if the height…
Bobby Sciacchitano
  • 851
  • 1
  • 10
  • 19
19
votes
5 answers

Using picasso library with a circle image view

I am looking at using the Picasso library to download an image from URL and pass this into circle image view, but since picasso requires that you pass in an actual imageView I have come to a standstill on how to do it I am using the picasso library…
MichaelStoddart
  • 5,571
  • 4
  • 27
  • 49
19
votes
7 answers

How can I show an image using the ImageView component in javafx and fxml?

I suppose it's a very simple thing but I just can't get behind it. All I want is to show an image over an ImageView linked to fxml. Here is my code: package application; import java.io.File; import javafx.application.Application; import…
user3472050
  • 191
  • 1
  • 1
  • 5
19
votes
3 answers

Alpha-gradient on Android

I need to create an alpha-gradient on the edge of the ImageView. Preferably using only XML. Image for example
ftp27
  • 885
  • 1
  • 12
  • 31