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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:43:56+00:00 2026-06-10T07:43:56+00:00

I need some help with my relativelayout. My Close button cant be seen when

  • 0

I need some help with my relativelayout. My “Close” button cant be seen when i launch my custom dialog. It can only be seen when i set my ScollView Height to around “200dp” . I do not want to manually set the height. Is there a way to accomplish it? Maybe using android:weightSum? Please show me how it is done. Thanks

OnMenuItemClickListener mAboutButtonClickListener = new OnMenuItemClickListener() {

         @Override
            public boolean onMenuItemClick(MenuItem item) {  

                final Dialog dialog = new Dialog(MainPageActivity.this);
                dialog.setContentView(R.layout.about_us);
                dialog.setTitle("About Us");
                dialog.setCancelable(true);

                TextView text = (TextView) dialog.findViewById(R.id.TextView01);

                try {
                    Resources res = getResources();
                    InputStream in_s = res.openRawResource(R.raw.disclaimer);

                    byte[] b = new byte[in_s.available()];
                    in_s.read(b);
                    text.setText(new String(b));

                } catch (Exception e) {
                    // e.printStackTrace();
                    text.setText("Error: can't show help.");
                }


                //set up button
                Button button = (Button) dialog.findViewById(R.id.Button01);
                button.setOnClickListener(new OnClickListener() {
                @Override
                    public void onClick(View v) {

                    dialog.dismiss();
                    }
                });


                dialog.show();
                return false;
            }
        };

My xml

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


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

        <ScrollView android:id="@+id/ScrollView01" 
                    android:layout_width="wrap_content" 
                    android:layout_height="wrap_content" 
                    xmlns:android="http://schemas.android.com/apk/res/android"
                    android:scrollbars="vertical" 
                    android:scrollbarAlwaysDrawVerticalTrack="true">

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

        </ScrollView>

        <Button android:id="@+id/Button01" 
                android:layout_below="@+id/ScrollView01"
                android:layout_width="wrap_content" 
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true" 
                android:text="Close"
                        android:layout_alignParentBottom="true"/>
    </RelativeLayout>
  • 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-10T07:43:58+00:00Added an answer on June 10, 2026 at 7:43 am

    You can use something like this.

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/root"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:orientation="vertical" >
    
    <ScrollView
      android:layout_width="match_parent"
      android:layout_height="0dip"
      android:layout_weight="1" >
    
     <TextView   android:id="@+id/TextView01"
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content"/>
    
     </ScrollView>
    
     <Button android:id="@+id/Button01" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="Close" />
    
     </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Need some help in creating function which can create folders recursively with giving path:
Need some help: I want to only pull back the results for a specific
I need some help. I want to generate numbers.But my numbers repeated. how can
Need some help with a #jQuery issue. Can someone look at this and tell
Need some help guys. For now, I can successfully get a single user timeline
need some help with saxon.net. Can anybody tell me how to output a xslt
Need some help... I have jasperserver 4.1 installed on my ubuntu. It runs via
Need some help with Activerecord Querying in a has_many :through association. Model: Job class
Need some help, please. I have a line of horizontal thumbnails loaded as ONE
Need some help to solve this. I have a gridview and inside the gridview

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.