Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7173659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:52:15+00:00 2026-05-28T15:52:15+00:00

i am making android UI (using Relative Layout)in which, i need to set one

  • 0

i am making android UI (using Relative Layout)in which, i need to set one banner whose size is 306 x 51. i have set it as center of screen. and it getting displayed well in some android mobile screen but when i run in tablet then display is like:

enter image description here

as shown in the image, space are remain left and right side. so what i do for it?

Code:

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


    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/login_rellay_01" android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <ImageView android:layout_height="wrap_content"
            android:layout_width="match_parent" android:src="@drawable/page1_1"
            android:id="@+id/imageView1" android:layout_alignParentLeft="true" />

        <TextView android:layout_height="wrap_content"
            android:layout_width="wrap_content" android:text="Shanesh COLORS App"
            android:textSize="13dp" android:textStyle="bold" android:textColor="#49515F"
            android:layout_centerInParent="true" />
    </RelativeLayout>

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_below="@+id/login_rellay_01" android:id="@+id/login_rellay_02"
        android:layout_width="fill_parent" android:layout_height="wrap_content">
        <ImageView android:layout_height="wrap_content"
            android:layout_width="wrap_content" android:src="@drawable/page1_4"
            android:id="@+id/imageView1" android:layout_centerHorizontal="true" />

        <TextView android:layout_height="wrap_content"
            android:layout_width="wrap_content" android:text="SIGN IN"
            android:textSize="13dp" android:textStyle="bold" android:textColor="#FFFFFF"
            android:layout_centerInParent="true" />
        <Button android:layout_height="wrap_content"
            android:layout_width="wrap_content" android:background="@drawable/page1_2"
            android:layout_centerVertical="true" android:layout_marginLeft="10dp" />
        <Button android:layout_height="wrap_content"
            android:layout_width="wrap_content" android:background="@drawable/page1_3"
            android:layout_centerVertical="true" android:layout_marginRight="10dp"
            android:layout_alignParentRight="true" />


    </RelativeLayout>



    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/login_rellay_03" android:layout_below="@+id/login_rellay_02"
        android:layout_width="match_parent" android:layout_height="wrap_content">


        <ImageView android:layout_height="wrap_content"
            android:layout_width="match_parent" android:src="@drawable/page1_5"
            android:id="@+id/imgv_page1_5" android:layout_alignParentLeft="true" />
        <!-- <ImageView android:layout_height="wrap_content" android:layout_below="@+id/imgv_page1_5" 
            android:layout_marginTop="1dp" android:layout_width="match_parent" android:src="@drawable/page1_6" 
            android:id="@+id/imgv_page1_6" android:layout_alignParentLeft="true" /> -->
        <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/login_rellay_03" android:layout_centerInParent="true"
            android:layout_below="@+id/login_rellay_02" android:layout_width="wrap_content"
            android:layout_height="wrap_content">
            <TextView android:layout_height="wrap_content"
                android:layout_width="wrap_content" android:text="SIGN IN "
                android:textSize="13dp" android:id="@+id/login_txvx_dwbnr_1"
                android:textStyle="bold" android:textColor="#000000"
                android:layout_marginLeft="10dp" android:layout_centerVertical="true" />
            <TextView android:layout_height="wrap_content"
                android:layout_width="wrap_content" android:text="with your "
                android:id="@+id/login_txvx_dwbnr_2" android:layout_toRightOf="@+id/login_txvx_dwbnr_1"
                android:textSize="13dp" android:layout_centerVertical="true"
                android:textColor="#000000" />
            <TextView android:layout_height="wrap_content"
                android:layout_width="wrap_content" android:text="Shanesh Colors"
                android:id="@+id/login_txvx_dwbnr_3" android:layout_toRightOf="@+id/login_txvx_dwbnr_2"
                android:textSize="13dp" android:textStyle="bold"
                android:layout_centerVertical="true" android:textColor="#000000" />
            <TextView android:layout_height="wrap_content"
                android:layout_width="wrap_content" android:text=" App Account "
                android:id="@+id/login_txvx_dwbnr_4" android:layout_toRightOf="@+id/login_txvx_dwbnr_3"
                android:textSize="13dp" android:layout_centerVertical="true"
                android:textColor="#000000" />
        </RelativeLayout>
    </RelativeLayout>

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/login_rellay_04" android:layout_marginTop="1dp"
        android:gravity="center" android:layout_below="@+id/login_rellay_03"
        android:layout_width="match_parent" android:layout_height="wrap_content">

        <ImageView android:layout_height="180dp"
            android:layout_width="306dp" android:background="#FFFFFF" android:id="@+id/imgv_page1_6"
            android:layout_centerInParent="true" />



        <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/login_rellay_04" android:layout_width="match_parent"
            android:layout_height="wrap_content" android:gravity="center">
            <TextView android:layout_height="wrap_content"
                android:layout_width="wrap_content" android:text="User Name:"
                android:id="@+id/login_txvx_dwbnr_5" android:layout_toRightOf="@+id/login_txvx_dwbnr_1"
                android:textSize="11dp" android:layout_centerVertical="true"
                android:textColor="#49515F" />

            <EditText android:layout_height="40dp" android:layout_width="220dp"
                android:layout_marginTop="10dp" android:layout_toRightOf="@+id/login_txvx_dwbnr_5" />



        </RelativeLayout>

        <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/login_rellay_05" android:layout_width="match_parent"
            android:layout_height="wrap_content" android:gravity="center"
            android:layout_below="@+id/login_rellay_04">
            <TextView android:layout_height="wrap_content"
                android:layout_width="wrap_content" 
                android:text=" Password:"
                android:id="@+id/login_txvx_dwbnr_5" 
                android:layout_toRightOf="@+id/login_txvx_dwbnr_1"
                android:textSize="11dp" 
                android:layout_centerVertical="true"
                android:textColor="#49515F" />

            <EditText android:layout_height="40dp" android:layout_width="220dp"
                android:layout_alignParentTop="true" android:layout_marginTop="10dp"
                android:layout_toRightOf="@+id/login_txvx_dwbnr_5" />



        </RelativeLayout>

        <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/login_rellay_06" 
            android:layout_marginTop="3dp"
            android:layout_height="wrap_content"
            android:gravity="center" 
            android:layout_below="@+id/login_rellay_05" 
            android:layout_width="match_parent">

            <TextView android:layout_height="wrap_content"
                      android:textColor="#000000"
                      android:text="No Account?"

                      android:textStyle="bold"
                      android:textSize="11dp" 
                      android:id="@+id/login_txvx_dwbnr_9" 

                      android:layout_width="wrap_content"/>

        <TextView android:text="Sign Up" 
          android:layout_height="wrap_content"
          android:layout_width="wrap_content" 
          android:id="@+id/login_txvx_signup_account" 
          android:textColor="#8891A2" 
          android:textStyle="bold" 
          android:layout_toRightOf="@+id/login_txvx_dwbnr_9"
          android:textSize="11dp" 
         /></RelativeLayout>
         <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/login_rellay_07" 

            android:layout_height="wrap_content"
            android:gravity="center_horizontal" 
            android:layout_below="@+id/login_rellay_06" 
            android:layout_width="match_parent">

         <CheckBox android:layout_height="wrap_content"
                android:id="@+id/checkBox1"
                android:layout_below="@+id/login_txvx_signup_account"
                android:layout_width="wrap_content" 
                android:textColor="#49515F" 
                android:textSize="11dp"
                android:layout_marginLeft="10dp"
                android:text=" Remember User Name and Password?" 
          />

          </RelativeLayout>





    </RelativeLayout>

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/login_rellay_08" 

            android:layout_height="wrap_content"
            android:gravity="center_horizontal" 
            android:layout_marginTop="60dp"
            android:layout_below="@+id/login_rellay_04" 
            android:layout_width="match_parent">

          <ImageView android:layout_height="wrap_content"
                     android:layout_width="wrap_content"
                     android:src="@drawable/page1_8"
                     />
          </RelativeLayout>
</RelativeLayout>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T15:52:16+00:00Added an answer on May 28, 2026 at 3:52 pm

    @zam664 is right … u should never use fixed widths for Layouts.. try managing them by padding, margins etc.

    Use LinearLayout too to manage horizontal children with non-fixed width..

    anyway… i modified ur xml a little … i could not test it fully as i did not have the images/resources u have used in it.. but give it a try.

    Replace the whole xml with the following. …

    Note: a have just changed it a little to give you idea … u should modify it further if that works

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent" 
    android:background="@drawable/page1_11"
    android:layout_height="fill_parent">
    
    
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/login_rellay_01" android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <ImageView android:layout_height="wrap_content"
            android:layout_width="match_parent" android:src="@drawable/page1_1"
            android:id="@+id/imageView1" android:layout_alignParentLeft="true" />
    
        <TextView android:layout_height="wrap_content"
            android:layout_width="wrap_content" android:text="Shanesh COLORS App"
            android:textSize="13dp" android:textStyle="bold" android:textColor="#49515F"
            android:layout_centerInParent="true" />
    </RelativeLayout>
    
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_below="@+id/login_rellay_01" android:id="@+id/login_rellay_02"
        android:layout_width="fill_parent" android:layout_height="wrap_content">
        <ImageView android:layout_height="wrap_content"
            android:layout_width="fill_parent" android:src="@drawable/page1_4"
            android:id="@+id/imageView1" android:layout_centerHorizontal="true" />
    
        <TextView android:layout_height="wrap_content"
            android:layout_width="wrap_content" android:text="SIGN IN"
            android:textSize="13dp" android:textStyle="bold" android:textColor="#FFFFFF"
            android:layout_centerInParent="true" />
        <Button android:layout_height="wrap_content"
            android:layout_width="wrap_content" android:background="@drawable/page1_2"
            android:layout_centerVertical="true" android:layout_marginLeft="10dp" />
        <Button android:layout_height="wrap_content"
            android:layout_width="wrap_content" android:background="@drawable/page1_3"
            android:layout_centerVertical="true" android:layout_marginRight="10dp"
            android:layout_alignParentRight="true" />
    
    
    </RelativeLayout>
    
    
    
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/login_rellay_03" android:layout_below="@+id/login_rellay_02"
        android:layout_width="match_parent" android:layout_height="wrap_content">
    
    
        <ImageView android:layout_height="wrap_content"
            android:layout_width="match_parent" android:src="@drawable/page1_5"
            android:id="@+id/imgv_page1_5" android:layout_alignParentLeft="true" />
        <!-- <ImageView android:layout_height="wrap_content" android:layout_below="@+id/imgv_page1_5" 
            android:layout_marginTop="1dp" android:layout_width="match_parent" android:src="@drawable/page1_6" 
            android:id="@+id/imgv_page1_6" android:layout_alignParentLeft="true" /> -->
        <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/login_rellay_03" android:layout_centerInParent="true"
            android:layout_below="@+id/login_rellay_02" android:layout_width="fill_parent"
            android:layout_height="wrap_content">
            <TextView android:layout_height="wrap_content"
                android:layout_width="wrap_content" android:text="SIGN IN "
                android:textSize="13dp" android:id="@+id/login_txvx_dwbnr_1"
                android:textStyle="bold" android:textColor="#000000"
                android:layout_marginLeft="10dp" android:layout_centerVertical="true" />
            <TextView android:layout_height="wrap_content"
                android:layout_width="wrap_content" android:text="with your "
                android:id="@+id/login_txvx_dwbnr_2" android:layout_toRightOf="@+id/login_txvx_dwbnr_1"
                android:textSize="13dp" android:layout_centerVertical="true"
                android:textColor="#000000" />
            <TextView android:layout_height="wrap_content"
                android:layout_width="wrap_content" android:text="Shanesh Colors"
                android:id="@+id/login_txvx_dwbnr_3" android:layout_toRightOf="@+id/login_txvx_dwbnr_2"
                android:textSize="13dp" android:textStyle="bold"
                android:layout_centerVertical="true" android:textColor="#000000" />
            <TextView android:layout_height="wrap_content"
                android:layout_width="wrap_content" android:text=" App Account "
                android:id="@+id/login_txvx_dwbnr_4" android:layout_toRightOf="@+id/login_txvx_dwbnr_3"
                android:textSize="13dp" android:layout_centerVertical="true"
                android:textColor="#000000" />
        </RelativeLayout>
    </RelativeLayout>
    
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/login_rellay_04" android:layout_marginTop="1dp"
        android:gravity="center" android:layout_below="@+id/login_rellay_03"
        android:layout_width="match_parent" android:layout_height="wrap_content">
    
        <ImageView android:layout_height="fill_parent"
            android:layout_width="fill_parent" android:background="#FFFFFF" android:id="@+id/imgv_page1_6"
            android:layout_centerInParent="true" />
    
    
    
        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/login_rellay_04" android:layout_width="match_parent"
            android:layout_height="wrap_content" android:orientation="horizontal" 
            android:paddingLeft="10dp" android:paddingRight="10dp">
            <TextView android:layout_height="wrap_content"
                android:layout_width="wrap_content" android:text="User Name:"
                android:id="@+id/login_txvx_dwbnr_5" android:layout_toRightOf="@+id/login_txvx_dwbnr_1"
                android:textSize="11dp" android:layout_centerVertical="true"
                android:textColor="#49515F" />
    
            <EditText android:layout_height="40dp" android:layout_width="fill_parent" android:layout_weight="1"
                android:layout_marginTop="10dp" android:layout_marginLeft="10dp"/>
    
    
    
        </LinearLayout>
    
        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/login_rellay_05" android:layout_width="match_parent"
            android:layout_height="wrap_content" android:orientation="horizontal"
            android:paddingLeft="10dp" android:paddingRight="10dp"
            android:layout_below="@+id/login_rellay_04">
            <TextView android:layout_height="wrap_content"
                android:layout_width="wrap_content" 
                android:text=" Password:"
                android:id="@+id/login_txvx_dwbnr_5" 
                android:layout_toRightOf="@+id/login_txvx_dwbnr_1"
                android:textSize="11dp" 
                android:layout_centerVertical="true"
                android:textColor="#49515F" />
    
            <EditText android:layout_height="40dp" android:layout_width="fill_parent"  android:layout_weight="1"
                android:layout_alignParentTop="true" android:layout_marginLeft="10dp"
                android:layout_toRightOf="@+id/login_txvx_dwbnr_5" />
    
    
    
        </LinearLayout>
    
        <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/login_rellay_06" 
            android:layout_marginTop="3dp"
            android:layout_height="wrap_content"
            android:gravity="center" 
            android:layout_below="@+id/login_rellay_05" 
            android:layout_width="match_parent">
    
            <TextView android:layout_height="wrap_content"
                      android:textColor="#000000"
                      android:text="No Account?"
    
                      android:textStyle="bold"
                      android:textSize="11dp" 
                      android:id="@+id/login_txvx_dwbnr_9" 
    
                      android:layout_width="wrap_content"/>
    
        <TextView android:text="Sign Up" 
          android:layout_height="wrap_content"
          android:layout_width="wrap_content" 
          android:id="@+id/login_txvx_signup_account" 
          android:textColor="#8891A2" 
          android:textStyle="bold" 
          android:layout_toRightOf="@+id/login_txvx_dwbnr_9"
          android:textSize="11dp" 
         /></RelativeLayout>
         <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/login_rellay_07" 
    
            android:layout_height="wrap_content"
            android:gravity="center_horizontal" 
            android:layout_below="@+id/login_rellay_06" 
            android:layout_width="match_parent">
    
         <CheckBox android:layout_height="wrap_content"
                android:id="@+id/checkBox1"
                android:layout_below="@+id/login_txvx_signup_account"
                android:layout_width="wrap_content" 
                android:textColor="#49515F" 
                android:textSize="11dp"
                android:layout_marginLeft="10dp"
                android:text=" Remember User Name and Password?" 
          />
    
          </RelativeLayout>
    
    
    
    
    
    </RelativeLayout>
    
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/login_rellay_08" 
    
            android:layout_height="wrap_content"
            android:gravity="center_horizontal" 
            android:layout_marginTop="60dp"
            android:layout_below="@+id/login_rellay_04" 
            android:layout_width="match_parent">
    
          <ImageView android:layout_height="wrap_content"
                     android:layout_width="wrap_content"
                     android:src="@drawable/page1_8"
                     />
          </RelativeLayout>
    

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have learned that when using android:entries with a ListView , it uses android.R.layout.simple_list_item_1
I'm making a program for an Android tablet, and have been using the SDK
I'm making an Android app using Processing, and have decided to port my code
im making an android application which requires a user to register using a form
I have started making graphics for my Android app using Adobe Photoshop. But I
I'm making my first game using Java on Android. I need to draw a
I’m making an android app, which uses Google maps. One functionality is that the
I am making the radio app.I have using the android media for playing radio
In my App I have 7 buttons aligned using relative layout. The order I
I am making an android app in which i am using google maps which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.