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 8190837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:46:06+00:00 2026-06-07T03:46:06+00:00

I have got relative layout, in that i have placed two textviews, one image

  • 0

I have got relative layout, in that i have placed two textviews, one image view & tabbed view. i have got tabbed view at bottom. I would like to add space between the tabview as well as the imageview. How to achieve it?.

Here is the source code

    <?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="wrap_content"
    android:padding="6dip">

    <ImageView
        android:id="@+id/icon"
        android:layout_width="100dip"
        android:layout_height="100dip"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:layout_marginRight="6dip"
        android:scaleType="center"
        android:src="@drawable/ic_launcher"/>

    <TextView
                    android:text="Hello world"
                    android:id="@+id/serviceName" 
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content" 
                    android:singleLine="true" 
                    android:focusable="true" 
                    android:focusableInTouchMode="true" 
                    android:freezesText="true"></TextView>

    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@+id/icon"
        android:layout_alignLeft="@+id/serviceName"
        android:gravity="center_vertical"
        android:text="123456789"
        android:textSize="30dip" />

  <TabHost
    android:id="@android:id/tabhost"
    android:layout_below="@+id/icon"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <TabWidget
            android:id="@android:id/tabs"
            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0"/>

          <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:layout_weight="0"/>

        <FrameLayout
            android:id="@+android:id/realtabcontent"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"/>

    </LinearLayout>
</TabHost>

</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-06-07T03:46:07+00:00Added an answer on June 7, 2026 at 3:46 am

    Try this

     <?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="wrap_content"
        android:padding="6dip">
    
        <ImageView
            android:id="@+id/icon"
            android:layout_width="100dip"
            android:layout_height="100dip"
            android:layout_alignParentLeft="true"
            android:layout_alignParentTop="true"
            android:layout_marginRight="6dip"
            android:scaleType="center"
            android:src="@drawable/ic_launcher"/>
    
        <TextView
                        android:text="Hello world"
                        android:id="@+id/serviceName" 
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content" 
                        android:singleLine="true" 
                        android:focusable="true" 
                        android:focusableInTouchMode="true" 
                        android:freezesText="true"></TextView>
    
        <TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@+id/icon"
            android:layout_alignLeft="@+id/serviceName"
            android:gravity="center_vertical"
            android:text="123456789"
            android:textSize="30dip" />
    
      <TabHost
        android:id="@android:id/tabhost"
        android:layout_below="@+id/icon"
        android:layout_marginLeft="6dip"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    
        <LinearLayout
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
    
            <TabWidget
                android:id="@android:id/tabs"
                android:orientation="horizontal"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="0"/>
    
              <FrameLayout
                android:id="@android:id/tabcontent"
                android:layout_width="0dp"
                android:layout_height="0dp"
                android:layout_weight="0"/>
    
            <FrameLayout
                android:id="@+android:id/realtabcontent"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"/>
    
        </LinearLayout>
    </TabHost>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got relative layout in my view hierarchy and I want it to have
I've got a custom component containing two TextViews that have a custom size-setting method
This one is weird. I have a list view that is a part of
In My application XML layout, I have one Relativelayout, In which there are two
I have got following XML structure of my screen. I want my Relative Layout
I have Relative Layout containing layers of different Relative layouts and Views. In one
I have got two pages. example.com/php.com and example.com. I use this function to set
I have a layout which specifies sizes of widgets in relative dimension, for example:
I have a rollover image that makes use of a large background image that
I've got an example layout that I'm trying to create in android using xml.

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.