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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:15:11+00:00 2026-05-16T02:15:11+00:00

I have a ListActivity whose layout looks like <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent

  • 0

I have a ListActivity whose layout looks like

<?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">
  <ListView android:id="@android:id/list" android:cacheColorHint="@color/transparent" style="@style/FullWidth.NoteList" />
  <LinearLayout android:id="@android:id/empty" style="@style/FillParent">
    <ImageView style="@style/NoNotesImage" />
    <TextView android:text="@string/no_notes" style="@style/Shadowed.NoNotesText" />
    <Button android:id="@+id/note_add" android:text="@string/note_add" style="@style/Shadowed.Button.Blue"/>
  </LinearLayout>
</LinearLayout>

The styles relevant here.

<?xml version="1.0" encoding="utf-8"?>
<style name="Shadowed">
  <item name="android:shadowDx">1.1</item>
  <item name="android:shadowDy">1.1</item>
  <item name="android:shadowRadius">1.1</item>
</style>
<style name="NoNotesImage">
  <item name="android:layout_width">fill_parent</item>
  <item name="android:layout_height">wrap_content</item>
  <item name="android:gravity">center</item>
  <item name="android:layout_marginTop">80.5dip</item>
  <item name="android:layout_marginLeft">20dip</item>
  <item name="android:src">@drawable/bg_no_notes</item>
</style>
<style name="Shadowed.NoNotesText">
  <item name="android:layout_width">fill_parent</item>
  <item name="android:layout_height">wrap_content</item>
  <item name="android:gravity">center</item>
  <item name="android:textSize">10sp</item>
  <item name="android:textColor">@color/no_notes_text</item>
  <item name="android:shadowColor">@color/no_notes_shadow</item>
</style>
<style name="FillParent">
  <item name="android:layout_width">fill_parent</item>
  <item name="android:layout_height">fill_parent</item>
</style>

However, my empty list view consist only of the ImageView listed first inside the nested LinearLayout.

This seems like a reasonable thing to do but I don’t completely understand Android’s layout rules yet.

  • 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-16T02:15:11+00:00Added an answer on May 16, 2026 at 2:15 am

    Well, I’m going to take a shot in the dark. The LinearLayout should work but I’m guessing that you’re accidentally pushing Views off the screen. I bet that LinearLayout’s android:orientation is accidentally being set to “horizontal” and the ImageView’s layout_width is “fill_parent”; doing that will block the TextView and the Button. You probably just need to change the LinearLayout’s android:orientation to “vertical” and it will work as expected.

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

Sidebar

Related Questions

I have the following XML layout for a ListActivity. <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android
I have a listactivity with the following layout-xml <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent
I have used this code for the row layout: <?xml version=1.0 encoding=utf-8?> <TextView xmlns:android=http://schemas.android.com/apk/res/android
Making this tutorial: http://developer.android.com/resources/tutorials/notepad/notepad-ex1.html I have ListActivity-derived class and onCreateContextMenu, onContextItemSelected overrides. I think
I have a ListActivity where the list items are defined in another XML layout.
I have implemented a ListActivity , and would like to launch a different intent
I have an Android app with a ListActivity in the main view. The list
When I have a ListActivity and an Adapter how does Android handle a list
I'm trying to use a ListView which is just like on this page: http://developer.android.com/resources/tutorials/views/hello-listview.html
I have a ListActivity in Android. Each row is just an item that starts

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.