The main function of the ImageView component is to provide a container for image display. The android. widget. ImageView class is defined as follows: java. lang. Object? Android. view. View? Android. widget. ImageView
Common Methods
| No. |
Configuration property name |
Method |
Description |
| 1 |
Android: maxHeight |
Public void setMaxHeight (int maxHeight) |
Define the maximum Image Height |
| 2 |
Android: maxWidth |
Public void setMaxWidth (int maxWidth) |
Defines the maximum width of an image. |
| 3 |
Android: src |
Public void setImageResource (int resId) |
Define the ID of the displayed Image |
Of course, there are many ways to set images in imageview. You can check the image in future development.
.................................................................. Beautiful cut line .................................................................. Select the drawable-hdip folder under res to put the prepared image
Then define the xml file
Running effect:
.................................................................. Beautiful cut line .................................................................. ImageButton and imageView are similar, except that ImageButton has an event listening mechanism, which is similar to some other operations and Button components. In Android, an image Button is provided, you can directly use ImageButton to define the class as follows: java. lang. object? Android. view. View? Android. widget. ImageView? Android. widget. ImageButton
Is the Display Effect of imageButton.
This section is relatively simple. You can refer to the APi for more methods. Next forecast:
Time selector:
TimePicker