Ques. : How to design/set Image in Android using XML codes in LinearView Layout?
<?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:layout_height="match_parent"
    android:contentDescription="@string/app_name"
    android:orientation="vertical"
    tools:context=".MainActivity"

    android:layout_margin="20dp">

    <ImageView
        android:layout_width="match_parent"
        android:layout_height="300dp"
        
        android:id="@+id/ImgView1"
        android:src="@drawable/ic_launcher_background"

        android:scaleType="fitXY"
        android:adjustViewBounds="true"

        android:contentDescription="Description of Image"/>
</LinearLayout>

Loading

Categories: Android

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.