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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:54:59+00:00 2026-06-06T09:54:59+00:00

I have a dialog with this content: <RelativeLayout android:layout_width=wrap_content android:layout_height=wrap_content > <ScrollView android:layout_width=fill_parent android:layout_height=wrap_content

  • 0

I have a dialog with this content:

<RelativeLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" >

    <ScrollView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_marginBottom="25dp" >
        <LinearLayout
           ...
        </LinearLayout>
    </ScrollView>

    <Button
        android:id="@+id/closebtn"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/scrollview"
        android:layout_centerHorizontal="true" />

</RelativeLayout>

I want the dialog to be sized vertically to fit as much of the content of the LinearLayout as it can. However, I’m finding that, if the contents of the LinearLayout are too tall, the ScrollView fills the dialog and the close button gets pushed past the bottom and is not visible.

One thing I tried was to make the Button layout_alignParentBottom=”true” and make the ScrollView layout_above=”@+id/closebtn”, but then the dialog always stretches to fill the whole screen vertically, even if the content of the LinearLayout is really short.

  • 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-06T09:55:07+00:00Added an answer on June 6, 2026 at 9:55 am

    I ended up changing my RelativeLayout to a LinearLayout to get this working. I didn’t do that originally because when I tried it it gave my a really tall and skinny dialog (the inner LinearLayout contains ImageViews and TextViews). But, surprisingly, changing all my views from width=fill_parent to wrap_content caused the dialog to stretch horizontally to fill the screen, which is what I wanted, and the height behaves correctly.

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

Sidebar

Related Questions

I have this nice dialog view I set my UserInputDialog class to: <LinearLayout android:id=@+id/LinearLayout01
I have an error in onCreateDialog() NullPointerException in this code: import android.app.Activity; import android.app.Dialog;
I have a faux dialog which uses this layout: <?xml version=1.0 encoding=utf-8?> <FrameLayout xmlns:android=http://schemas.android.com/apk/res/android
EDIT: I didn't post my XML for this dialog. <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android
I have dialog created like this $('#add_error').click(function(e) { $('<div>') .load('/someaction/format/html/') .dialog({ title: 'Some title',
When the user presses the X in the Main Window, I have this dialog
I have click events set up like this: $('.dialogLink') .click(function () { dialog(this); return
I have a modal dialog containing a JLabel. This dialog calls a method in
Well i have a div tag that i show as a modal dialog this
I have fragment that on a component click pop-ups DialogFragment. This dialog fragment holds

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.