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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:28:37+00:00 2026-06-06T11:28:37+00:00

I want to write a small Android app with a GUI that should display

  • 0

I want to write a small Android app with a GUI that should display an image on the top of the (portrait) screen, directly below a TextView that might contain some info text (or simply is blank/empty), and at the bottom of the screen a button. So in between the (empty) Textview (below the image on top) and the button should be “maximum” empty space, depending on the screen size of the devive.

So, in other words: the group of image and TextView should float on top of the screen, the bottom should float on the bottom of the screen, with a dynamic amount of empty space in between.

So I ended up with this layout XML:

<?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:orientation="vertical" >

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical" >

    <ImageView
        android:id="@+id/curr_image"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal|top"
        android:layout_margin="6dip" />

    <TextView
        android:id="@+id/image_info_text"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" />

</LinearLayout>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom"
    android:orientation="vertical" >

    <Button
        android:id="@+id/button"
        android:text="@string/rate_button_text"
        android:layout_width="fill_parent"
        android:layout_height="60dip"
        android:layout_gravity="center_horizontal|bottom"
        android:layout_margin="6dip" />

</LinearLayout>

</LinearLayout>

However, with this layout everything floats on the top of the screen, the button is not rendered to the bottom of the screen, as described above.

Any ideas what I am doing wrong here?
Thanks in advance for your help!

  • 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-06T11:28:39+00:00Added an answer on June 6, 2026 at 11:28 am

    Try changing the layout you want on the bottom to this:

    <LinearLayout 
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:orientation="vertical" >
    

    also note that you only need this:

    xmlns:android="http://schemas.android.com/apk/res/android"
    

    In the very first item of the xml file. You should remove it from all of your layouts except for the first one in the file.

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

Sidebar

Related Questions

I want to write a small program that should print something like testing CPU...
I want to write a small app that sits in my tray and that
I want to write a small bit of data from my app to the
I want to write a small backup script that would take my shelf changes
so I'm trying to write a small piece of android code where I want
I want to write an Android remote control application that allows people to navigate
I want to write a small program that given a time (in minutes) as
I want to write a small web app which does this things: deliver a
I want to write an iPhone app - view image app. And I have
I have a mobile app on android that needs to send small amounts of

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.