Hello,
This article is for Beginner and people who want to learn Android .This article is about How to display image in Imageview Example.
1. XML File .
activity_main -
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="match_parent"
tools:context=".MainActivity">
<ImageView
android:id="@+id/img"
android:background="@drawable/android_logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
No comments:
Post a Comment
If you have any doubts,Please let me know