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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:48:16+00:00 2026-06-05T21:48:16+00:00

I have created a TableLayout with a listView in it. I define the listView’s

  • 0

I have created a TableLayout with a listView in it. I define the listView’s size by setting it in dp. My problem is when uploading the app on a mobile with a smaller screen the listView gets to big(long) on the screen. I dont want to use a ScrollView and have a listView within it. Is there any other way to set the size of the listview which will be the same and not dependent of what mobile you are using?

Picture of the listView: http://tinypic.com/view.php?pic=2qwhoxd&s=6

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

<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/bakgrunden"
android:orientation="vertical"
android:gravity="center|top"
android:stretchColumns="1"
android:weightSum="1.0" >

<TableRow>
<TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" />
</TableRow> 

<TableRow
android:paddingLeft="22dp"
android:paddingRight="25dp"
android:paddingTop="15dp" >

<ListView
    android:id="@+id/latest_list"
    style="@style/CustomListView"
    android:layout_width="wrap_content"
    android:layout_height="390dp" <------- THE PROBLEM! The list gets to long for a
    android:gravity="left"/>               small-screen mobile.
</TableRow> 

</TableLayout>
  • 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-05T21:48:18+00:00Added an answer on June 5, 2026 at 9:48 pm

    Simply create a different layout for the smaller screens and allow the OS to determine which layout to load. The Android Developers site has this excellent advice: Supporting Different Screen Sizes

    You could try getting fancy with layout_weight attributes or adjusting the height at run-time by determining each screen’s size ( Get screen dimensions in pixels ) then calculating the appropriate height… But honestly a couple different layouts is the easiest, future-proof approach.

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

Sidebar

Related Questions

I have created a table (TableLayout) which shows the amount of minutes used calling
i have created following layout. <TableLayout android:layout_width=fill_parent android:layout_height=wrap_content android:orientation=horizontal > <TableRow> <TextView android:layout_width=fill_parent android:layout_height=wrap_content
I have a ListView which I've created a custom view for each row. My
Dear friends, I have created one music app. It contains some collection of albums,
I have a TableLayout that is created programmatically in an Android project. I keep
I have the following problem spanning dynamically added rows to a TableLayout inside a
I have created a login page for an App I am creating. I am
I have a tableLayout that is created programmatically, about 23 items are added to
In my app i created an activity i have place a 5 continuous edit
Context: I have a TableLayout (created using XML), which has one TableRow, which has

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.