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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:17:23+00:00 2026-05-27T03:17:23+00:00

I have a xml in Android which is <TextView android:layout_width=wrap_content android:layout_height=wrap_content android:layout_marginLeft=122px android:layout_marginTop=40px android:id=@+id/am

  • 0

I have a xml in Android which is

 <TextView 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginLeft="122px"
    android:layout_marginTop="40px"
    android:id="@+id/am"
    android:text="@string/iam"
    android:textColor="#000000" android:textSize="20px">
    </TextView>

    <TextView 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textStyle="bold"
    android:layout_marginTop="40px"
    android:id="@+id/jname"
    android:textColor="#000000" android:textSize="20px" >
    </TextView>

<TextView 
android:layout_width="wrap_content"
android:layout_height="wrap_content"

android:id="@+id/going"
android:text="@string/sloc"
android:textColor="#000000" android:textSize="20px">
</TextView>

My TextView jname will be dynamic i.e. I will be filling the spot with the data from JSON. What I want is that my TextView of the id jname should always come to the right of the TextView having source @string/iam and left of TextView having source @string/sloc. I don’t want to define layout_margin attributes because that would fix the positions and everything will overlap if the width of the dynamic data is not proper. Help!

  • 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-27T03:17:24+00:00Added an answer on May 27, 2026 at 3:17 am

    If your problem is purely with layout, then just enclose all of that in a LinearLayout and set a weight for the middle TextView.

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content">
        <TextView 
            android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="122px"
                android:layout_marginTop="40px"
                android:id="@+id/am"
                android:text="@string/iam"
                android:textColor="#000000" android:textSize="20px">
            </TextView>
    
        <TextView 
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textStyle="bold"
            android:layout_marginTop="40px"
            android:id="@+id/jname"
            android:textColor="#000000" android:textSize="20px"
            android:layout_weight="1">
        </TextView>
    
        <TextView 
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/going"
            android:text="@string/sloc"
            android:textColor="#000000" android:textSize="20px">
        </TextView>
    </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following TextView in my XML layout file:- <TextView android:layout_width=fill_parent android:layout_height=wrap_content android:text=@string/autolink_test
I have a layout file( layout/my_test.xml ): <TextView android:id=@+id/my_title android:gravity=left|center_vertical android:layout_width=wrap_content android:layout_height=fill_parent /> My
The main.xml file code: <TableRow android:id=@+id/TableRow01 android:layout_width=wrap_content android:layout_height=wrap_content> <TextView android:text=User android:id=@+id/TextView01 android:layout_width=wrap_content android:layout_height=wrap_content></TextView> <EditText
I have a layout defined in XML. It contains also: <RelativeLayout android:id=@+id/item android:layout_width=fill_parent android:layout_height=wrap_content
I have a style applied to my whole application: AndroidManifest.xml: <application android:theme=@style/ApplicationStyle android:icon=@drawable/icon android:label=@string/app_name>
I have this XML code which generates a button, a textview and another button,
I have a simple layout like below (which only shows a text TEST): <?xml
I have a simple layout, which shows a text and a image: <?xml version=1.0
I have the following XML layout for a ListActivity. <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android
I'm defining a style XML for my android app. I have some TTF files

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.