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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:04:53+00:00 2026-06-06T22:04:53+00:00

I am having trouble creating a layout for a dialog I want to display

  • 0

I am having trouble creating a layout for a dialog I want to display a dialog with a scrollview but with buttons always showing at the bottom but when the scrollview gets too big it pushes the buttons at the bottom off the screen.

I can get the desired effect if i align the buttons at the bottom of the parent to true but then if the scrollview has very little content in it there will be a big dialog with a lot of empty space.

here is what I currently have

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

    <ScrollView
    android:id="@+id/scrollView1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

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

        <TextView
            android:id="@+id/staCalCompany"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="20dp"
            android:layout_marginLeft="15dp"
            android:layout_marginTop="30dp"
            android:text="Company Name"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:textColor="#ff2525"
            android:textSize="25sp" />

        <LinearLayout
            android:id="@+id/linearLayout1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" >

            <TextView
                android:id="@+id/staCalStart"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="15dp"
                android:text="Start:"
                android:textAppearance="?android:attr/textAppearanceMedium"
                android:textColor="#ff2525" />

            <TextView
                android:id="@+id/staCalStartDisp"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dp"
                android:text="Start Time"
                android:textAppearance="?android:attr/textAppearanceMedium" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/linearLayout2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="20dp" >

            <TextView
                android:id="@+id/staCalEnd"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="15dp"
                android:text="End:"
                android:textAppearance="?android:attr/textAppearanceMedium"
                android:textColor="#ff2525" />

            <TextView
                android:id="@+id/staCalEndDisp"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dp"
                android:text="End Time"
                android:textAppearance="?android:attr/textAppearanceMedium" />
        </LinearLayout>

        <TextView
            android:id="@+id/staCalSubDisp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="10dp"
            android:layout_marginLeft="15dp"
            android:text="Name"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:textColor="#ff2525" />

        <TextView
            android:id="@+id/staCalDesc"
            android:layout_width="285dp"
            android:layout_height="wrap_content"
            android:layout_marginBottom="20dp"
            android:layout_marginLeft="15dp"
            android:text="Description"
            android:textAppearance="?android:attr/textAppearanceMedium" />
        </LinearLayout>
        </ScrollView>

<RelativeLayout
            android:id="@+id/linearLayout3"
            android:layout_width="match_parent"
            android:layout_height="60dp"
            android:layout_gravity="bottom|center_horizontal" 
            android:gravity="center_horizontal" 
            android:layout_below="@+id/scrollView1">

            <ImageButton
                android:id="@+id/calIconSync"
                android:layout_width="60dp"
                android:layout_height="60dp"
                android:layout_marginLeft="20dp"
                android:background="@drawable/calendar_plus" />

            <ImageButton
                android:id="@+id/btnStaCalClose"
                android:layout_width="60dp"
                android:layout_height="60dp"
                android:layout_alignParentRight="true"
                android:layout_marginRight="20dp"
                android:background="@drawable/closepopup" />
        </RelativeLayout>

trying to get it to display correctly in both landscape and portrait mode but when one works the other does not.

any suggestions on how to go about doing this?

  • 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-06T22:04:55+00:00Added an answer on June 6, 2026 at 10:04 pm

    In these cases I just create some other invisible dummy buttons below and align these in such a way that my “real” buttons are positioned correctly.

    If the dummy buttons get pushed off the screen that’s fine, the real buttons are above them.
    If there is little stuff on the screen the dummy buttons are at the bottom and the “real” buttons are somewhere in the middle.

    Make the “invisible” buttons with width = “1dp” and height as much as you need. But leave them visible in the ANdroid sense

    EDIT:
    you could create a relativeview that aligns its bottom to the bottom of your list view and give it a maxHeight. align your buttons below this relative view. When the listview is small your buttons will be positioned right below it, if your listview is long the relative view exceeds the maxHeight and ensures that it is still on screen so your buttons will be right below the maxHeight. Make sure that maxHeight of the relativeView leaves enough room on the bottom of the screen for the buttons.

    To adjust the maxHeight so it leaves enough room for the buttons on any screen size you may use this to get the screensize of the device and adjust the maxHight accordingly to the screenHeight:

    Display display = getWindowManager().getDefaultDisplay();
    Point size = new Point();
    display.getSize(size);
    int screenHheight = size.y;
    

    Hope that helps also in your case…

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

Sidebar

Related Questions

I'm having trouble creating a layout that looks like a row in a table,
I'm having trouble creating the layout I would like for a website. I don't
I am trying to create a link list, but I am having trouble creating
I am having trouble creating a ButtonGroup containing radio buttons in the Scala Programming
So I'm creating a layout for my site. I'm having trouble with displaying my
I'm having trouble creating multiple AS3 classes, I've got my document class but can't
I am having trouble creating an XML document that contains a default namespace and
I'm currently having trouble creating an image from a binary string of data in
I'm having trouble creating a global function accessible from within all classes. I receive
I'm having trouble creating an Access table using VBA, then accessing it via open-recordset.

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.