Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

imageview position setting like this image

I like to setting Imageview like this.

(http://wemakeucc.com/4.jpg) <-Check image please

I only use imageview like this until now.

<ImageView
     android:id="@+id/a_01_b"
     android:layout_width="wrap_content"
     android:layout_height="match_parent" 
     android:src="@drawable/a_01_i" />

so I want to know code that can setting imageview like that image.

what should i do?

like image 672
Alex-Hyun Avatar asked Jun 16 '26 04:06

Alex-Hyun


2 Answers

See the following xml below

<?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >

    <ImageView android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_alignParentRight="true"
       android:layout_marginRight="40dip"
       android:layout_marginTop="60dip" // give dip value according to where you want to place first image view from top
       android:background="@color/black" // set image according to you
       android:id="@+id/imageviewone" />

    <ImageView android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_alignParentLeft="true"
       android:layout_marginLeft="40dip"
       android:layout_marginTop="60dip" // give dip value what you have given to first edit text
       android:background="@color/black" // set image according to you
       android:layout_below="@+id/imageviewone"
       android:id="@+id/imageviewtwo" />
    </RelativeLayout>

let me know if this helps you

like image 111
Abhinav Singh Maurya Avatar answered Jun 17 '26 18:06

Abhinav Singh Maurya


here is the code as per your requirement :

xml file: and screenshots

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="right"
        android:orientation="vertical"
        android:paddingBottom="30dp"
        android:paddingRight="20dp"
        android:paddingTop="20dp" >

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/android" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="right"
        android:orientation="vertical"
        android:paddingBottom="30dp"
        android:paddingRight="120dp"
        android:paddingTop="20dp" >

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/android" />
    </LinearLayout>

</LinearLayout>

enter image description here

now just set the padding as per ur need...

like image 38
Nipun Gogia Avatar answered Jun 17 '26 19:06

Nipun Gogia