activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/rl" android:layout_width="match_parent" android:layout_height="match_parent" android:padding="10dp" tools:context=".MainActivity" android:background="#aac4a4" > <!-- ImageView Displays an arbitrary image, such as an icon. The ImageView class can load images from various sources. --> <!-- android:src Sets a drawable as the content of this ImageView. May be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name". May be a color value, in the form of "#rgb", "#argb", "#rrggbb", or "#aarrggbb". This corresponds to the global attribute resource symbol src. --> <!-- Set ImageView image in XML layout --> <ImageView android:id="@+id/iv" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/android_image" android:padding="5dp" android:layout_margin="10dp" /> </RelativeLayout>
- How to set an image to ImageView
- How to programmatically set image to ImageView
- How to set ImageView image from URL
- How to set ImageView image from drawable
- How to set ImageView image from Assets
- How to set a bitmap to ImageView
- How to create an ImageView programmatically
- How to set ImageView width and height programmatically
- How to set OnClickListener for an ImageButton
- How to add a border to an ImageButton
Komentar
Posting Komentar