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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:29:56+00:00 2026-05-27T17:29:56+00:00

I am writing XML in following way, list_item2 contains TextView and EditText, while list_item

  • 0

I am writing XML in following way, list_item2 contains TextView and EditText, while list_item is another XML contains only TextView,

<?xml version="1.0" encoding="utf-8"?>

<TextView android:id="@+id/textItem"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:padding="10dp"
    android:textSize="16sp" >
</TextView>

    <EditText
    android:id="@+id/editText1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" >
</EditText>

I am using the xml in ListView, such as

public View getView(int position, View convertView, ViewGroup parent) {
        View row;

        if(position!=2) {
                LayoutInflater inflater = getLayoutInflater();
                row = inflater.inflate(R.layout.list_item, parent, false);
        }
        else {
            LayoutInflater inflater = getLayoutInflater();
            row = inflater.inflate(R.layout.list_item2, parent, false);
        }
        TextView tv = (TextView) row.findViewById(R.id.textItem);
        tv.setText(getItem(position));

        tv.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub

            }
        });

but It is creating output like

 TextView

 EditText

I want both on same row, such as

   TextView        EditText

Any one edit the XML and let me know the hierarchy for creating GUI in Android Apps

  • 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-27T17:29:57+00:00Added an answer on May 27, 2026 at 5:29 pm

    Take your EditText and TextView inside a LinearLayout having horizontal orientation (which is applied by default) and set layout_weight = 1 or whatever do you want to EditText and TextView

    <LinearLayout android:layout_width="fill_parent"
        android:layout_height="fill_parent" >
    <TextView android:id="@+id/textItem"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_weight="1"
        android:padding="10dp"
        android:textSize="16sp" />
        <EditText
        android:id="@+id/editText1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1"/ >
    </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am encountering problems writing XML files using PHP. The following is my php
I'm writing an XML file with the following code: Source source = new DOMSource(rootElement);
I've seen a technique of reading and writing XML to disk using only C#
While implementing XML file reading/writing in my application I saw that when I call
I'm currently writing out xml and have done the following: header (content-type: text/xml); header
I am writing some code to parse an xml file of the following format
In other words, is there a faster, more concise way of writing the following
I'm writing a small Scala app that does the following: 1) Read XML/XHTML files
I have a table which contains records which are related in the following way:
When writing xml files, I know following is working: android:padding=20px Are there other valid

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.