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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:56:06+00:00 2026-06-09T13:56:06+00:00

I have an XML layout for a view representing one item as displayed by

  • 0

I have an XML layout for a view representing one item as displayed by a ExpandableListAdapter. (The XML that is duplicated once for each list item, not the main activity layout). I initially tried a LinearLayout but this hid the final of the three widgets (a image button). I understand why that doesn’t work but I then tried a RelativeLayout but the text view does not show.

I’ll display the relative layout first along with a screenshot and also append my initial layout and screenshot at the bottom FWIW. Thanks for any help.

<?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="55dip"
    android:orientation="horizontal" >
    <CheckBox
        android:id="@+id/chkParent"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:checked="false"/>
    <EditText
        android:id="@+id/edtParent"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_toLeftOf="@id/chkParent"
        android:textSize="17dip"
        android:inputType="text"
        android:hint="@string/strItem"/>
     <ImageButton
        android:id="@+id/btnExpand"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_toLeftOf="@id/edtParent"
        android:src="@drawable/dark_expand"
        android:clickable="true"
        android:hint="@string/strViewSubItems"
        android:contentDescription="@string/strViewSubItems"
        android:background="@null"/>  
 </RelativeLayout>

screenshot for relative layout

Original linear layout:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="55dip"
    android:orientation="horizontal" >
    <CheckBox
        android:id="@+id/chkParent"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:checked="false"/>
    <EditText
        android:id="@+id/edtParent"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:textSize="17dip"
        android:inputType="text"
        android:hint="@string/strItem"/>
    <ImageButton
        android:id="@+id/btnExpand"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:src="@drawable/dark_expand"
        android:clickable="true"
        android:hint="@string/strViewSubItems"
        android:contentDescription="@string/strViewSubItems"
        android:background="@null"/>  
 </LinearLayout>

screenshot for linear layout

  • 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-09T13:56:07+00:00Added an answer on June 9, 2026 at 1:56 pm

    Pretty sure your toLeftOf attributes should be toRightOf attributes. Give that a shot and see what happens.

    Actually, your EditText should be set toRightOf="@id/chkParent" and toLeftOf="@id/btnExpand. Your ImageButton doesn’t even need the toRightOf modifier, the alignParentRight attribute should cover it.

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

Sidebar

Related Questions

I have one ImageButton in my xml layout like that : <ImageButton android:id=@+id/tabsButton android:background=@drawable/button
I have the following XML layout for an item that I put in my
I currently have an activity that does not have an xml layout file. All
I have implemented a custom view within another activity into a XML layout. The
I have an XML layout that defines a TextView box 50px x 320px who
I have an xml layout which I use for each row in my listview:
I have a layout xml file named my_layout.xml, in which the root view's layout_width
I thought I have understood the XML layout of Android, but it seems that
I have a custom View extending SurfaceView. The XML layout is <com.myPackage.MyCustomView android:id=@+id/mycview android:layout_width=fill_parent
I have a custom View that I'd like to specify the layout of in

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.