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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:39:17+00:00 2026-05-29T10:39:17+00:00

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

  • 0

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 
    android:text="" 
    android:id="@+id/username" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content"

    ></EditText>

    <TextView 
    android:text="Test" 
    android:id="@+id/usernameTest" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content"

    ></TextView>

</TableRow>

<TableRow 
android:id="@+id/TableRow05" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content"
>
    <TextView 
    android:text="Hobby" 
    android:id="@+id/hobby" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content"></TextView>

    <CheckBox 
    android:text="A" 
    android:id="@+id/reading" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content"
    android:layout_column="1"
    ></CheckBox>
    <CheckBox 
    android:text="B" 
    android:id="@+id/swimming" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content"
    android:layout_column="1"
    ></CheckBox>


</TableRow>

I have looked in the official android docs, from which I learned, android:layout_column means The index of the column in which this child should be. I’ve set the attribute on the two CheckBox: android:layout_column = "1", so I thought the two CheckBox should both in the second column(index: 1). but to my amazement, the first CheckBox is in the second column, and the second CheckBox is in the third column , just as you can see below:
enter image description here

Can anyone explain why?

  • 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-29T10:39:18+00:00Added an answer on May 29, 2026 at 10:39 am

    You can’t put two Views in the same column. The first CheckBox goes in the column 1 as you set it with android:layout_column = "1" and the second CheckBox is automatically placed in the 2th column.

    Edit: If you do want your checkboxes in the same column you could just wrap them with a LinearLayout and then set the android:layout_column = "1" for that 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 main.xml file with a LinearLayout <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android
In my code i'm using and XML file for showing a view in Android.
Is it possible to use Java code to write to the main.xml file? I
I added some UI elements to the main.xml file in the res\layout folder and
I have 2 xml files, a main file where I have a listView and
I have a listView, a main xml file and a customListview xml file. for
I am using lxml to read my xml file. I am using a code
flash file loads text from xml. How can hyper links be used in the
I am working on a new module of Email application in android. My main.xml
I have a task to add a composite widget into the main ui.xml file,

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.