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

  • Home
  • SEARCH
  • 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 6898119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:15:20+00:00 2026-05-27T07:15:20+00:00

I’m currently developing an Android app and I’ve got an issue concerning layout. In

  • 0

I’m currently developing an Android app and I’ve got an issue concerning layout. In my XML layout file, I create a relative layout (fill_parent for width and wrap_content for height) which contains a list View (or possibly an expendable List View – fill_parent for height and width). In the corresponding activity onCreate method, I just set the adapter corresponding to my list and attach it to my list. The problem is that when I run my app the relative layout only has a size of 93dip and so it hides my list which has a size from 67 to 210dip when I would like the relative layout height to stick to the list current size (The size will never change through action in the activity just possibly when creating or resuming the activity). Would anyone have an idea of a solution to fix that ?

Some code as asked :

<LinearLayout android:id="@+id/content" 
              android:layout_width="fill_parent" 
              android:background="@drawable/row" 
              android:layout_below="@+id/header" 
              android:layout_height="wrap_content">
      <ListView android:id="@+id/list" 
                android:layout_width="fill_parent" 
                android:layout_height="fill_parent" 
                android:background="@drawable/listrow"/>
</LinearLayout>

And in the java file (where snapRecords is my object lists):

m_panel = (RelativeLayout)findViewById(R.id.lastFareRecordPanel);
ListView lv = (ListView)m_panel.findViewById(R.id.list);
final QuickSnapBookmarksAdapter adapter = new QuickSnapBookmarksAdapter(snapRecords, getApplicationContext(), this, lv);
lv.setAdapter(adapter);

Many thanks in advance for your help !

Benja

  • 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-27T07:15:20+00:00Added an answer on May 27, 2026 at 7:15 am

    I had a similiar situation.When I changed parent layout into LinearLayout, it is working.Here is the code:

      <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="#FFFFFF"
        android:orientation="vertical" >
    
        <LinearLayout
            android:id="@+id/LinearLayout"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" >
    
            <ImageButton
                android:id="@+id/prev"
                android:layout_width="106dip"
                android:layout_height="wrap_content"
                android:layout_gravity="right"
                android:background="@null"
                android:onClick="prev"
                android:paddingTop="8dip"
                android:src="@drawable/previous" >
            </ImageButton>
    
            <ImageButton
                android:id="@+id/next"
                android:layout_width="106dip"
                android:layout_height="wrap_content"
                android:layout_gravity="right"
                android:background="@null"
                android:onClick="next"
                android:paddingTop="8dip"
                android:src="@drawable/next" >
            </ImageButton>
    
            <ImageButton
                android:id="@+id/Logout"
                android:layout_width="106dip"
                android:layout_height="wrap_content"
                android:layout_gravity="right"
                android:background="@null"
                android:onClick="logout"
                android:paddingTop="8dip"
                android:src="@drawable/logout1"
                android:text="@string/Logout" >
            </ImageButton>
        </LinearLayout>
    
        <ListView
            android:id="@android:id/list"
            android:layout_width="wrap_content"
            android:layout_height="330dip" >
        </ListView>
    
        <TextView
            android:id="@android:id/empty"
            android:layout_width="fill_parent"
            android:layout_height="338dip"
            android:text="@string/EmptyList"
            android:textSize="35dip" />
    
        <LinearLayout
            android:id="@+id/LinearLayout1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" >
    
            <ImageButton
                android:id="@+id/prev1"
                android:layout_width="106dip"
                android:layout_height="wrap_content"
                android:layout_gravity="right"
                android:background="@null"
                android:onClick="prev"
                android:src="@drawable/previous" >
            </ImageButton>
    
            <ImageButton
                android:id="@+id/next1"
                android:layout_width="106dip"
                android:layout_height="wrap_content"
                android:layout_gravity="right"
                android:background="@null"
                android:onClick="next"
                android:src="@drawable/next" >
            </ImageButton>
    
            <ImageButton
                android:id="@+id/Logout"
                android:layout_width="106dip"
                android:layout_height="wrap_content"
                android:layout_gravity="right"
                android:background="@null"
                android:onClick="logout"
                android:src="@drawable/logout1"
                android:text="@string/Logout" >
            </ImageButton>
        </LinearLayout>
    
    </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want use html5's new tag to play a wav file (currently only supported
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I'm parsing an XML file, the creators of it stuck in a bunch social
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

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.