| java.lang.Object | ||
| ↳ | com.neomades.ui.View | |
| ↳ | com.neomades.ui.ImageLabel | |
An ImageLabel represents an Image into Screen.
This class is used to display an Image
By default, the scale type is STRETCH so when using method
setStretchMode(int, int) the image inside the ImageLabel is resized
according to the new stretch mode.
To prevent the behavior, the user has to set a different scale type.
| XML Attributes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Attribute Name | Related Method | Description | |||||||||
| image | setImage(Image) | Res.image.XXXX or a color | |||||||||
|
[Expand]
Inherited XML Attributes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.neomades.ui.View
| |||||||||||
|
[Expand]
Inherited Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From interface
com.neomades.ui.Alignment
| |||||||||||
From interface
com.neomades.ui.StretchMode
| |||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
ImageLabel()
Constructs an Image label with no image attached
| |||||||||||
|
ImageLabel(Image image)
Constructs an image label with the image given
| |||||||||||
|
ImageLabel(int resId)
Constructs an image label with the image given
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Image |
getImage()
Returns the current image of this label
| ||||||||||
| void |
setImage(int resId)
Sets the image that will be displayed by this label
| ||||||||||
| void |
setImage(Image image)
Sets the image that will be displayed by this label
| ||||||||||
| void |
setImageScaleType(int scaleType)
Set the scale type for the image contained into this button.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.neomades.ui.View
| |||||||||||
From class
java.lang.Object
| |||||||||||
Constructs an Image label with no image attached
Constructs an image label with the image given
| image | the image to attach to this ImageLabel |
|---|
Constructs an image label with the image given
| resId | the image id attached to this image label |
|---|
Sets the image that will be displayed by this label
| resId | the image id attached to this image label |
|---|
| CrossThreadException | if the method is called from outside the UI-Thread |
|---|
Sets the image that will be displayed by this label
| image | the image to display |
|---|
| CrossThreadException | if the method is called from outside the UI-Thread |
|---|