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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:40:36+00:00 2026-05-22T17:40:36+00:00

I cannot get the Theme.Dialog activity to get smaller. The problem is that i

  • 0

I cannot get the Theme.Dialog activity to get smaller.
The problem is that i want half the hight only.
Look at the picture down below.

Here is the manifest:

 <activity android:name=".PopUpSettings" 
          android:label="@string/app_name" 
          android:theme="@android:style/Theme.Dialog"
          android:screenOrientation="portrait"
          android:configChanges="keyboardHidden|orientation">

here is the xml:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:paddingTop="15dp"
    android:paddingLeft="15dp"
    android:paddingRight="15dp"
    android:paddingBottom="15dp"
    >

    <com.hellberg.ptppservice.imageedit.ColorPicker 
        android:id="@+id/color_picker_popup_settings"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" 
        android:layout_alignParentRight="true"
        />

    <TextView android:id="@+id/exampeltext_popup_settings"
        android:text = "This is the best app in the world"
        android:textSize="20sp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toLeftOf="@+id/color_picker_popup_settings"
        />

    <Button android:id="@+id/fontleft_button_popup_settings" 
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:layout_alignParentLeft="true"
        android:layout_alignParentBottom="true"
        />

    <Button android:id="@+id/fontright_button_popup_settings" 
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:layout_alignParentRight="true"
        android:layout_alignParentBottom="true"
        />      

    <TextView android:id="@+id/textlogo_popup_settings"
        android:text = "©2011"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_alignParentBottom="true"
        />      
</RelativeLayout>

Here is the screen:

Here is the screen

  • 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-22T17:40:37+00:00Added an answer on May 22, 2026 at 5:40 pm

    This will do what you want. Be aware that you’ll get the full window height so dividing with 2 wont make it exactly half the size. I tried your layout dividing with 3 and it looks good.

    public class DialogExampleActivity extends Activity {   
    
        private int mWindowHeight;
    
        private static final int DIALOG_OPEN = 0;
    
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
    
            Display display = getWindowManager().getDefaultDisplay();        
            mWindowHeight = display.getHeight();
    
            showDialog(DIALOG_OPEN);
        }
    
        @Override
        protected Dialog onCreateDialog(int id) {
            Dialog myDialog = new Dialog(DialogExampleActivity.this);
    
            switch (id) {
            case DIALOG_OPEN:
                myDialog.setContentView(R.layout.my_dialog);            
                myDialog.setCancelable(true);
    
                RelativeLayout rr = (RelativeLayout) myDialog.findViewById(R.id.relative_layout);
                LayoutParams params = rr.getLayoutParams();         
                params.height = mWindowHeight / 3;          
                rr.setLayoutParams(params);
    
                return myDialog;
            }
    
            return null;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I cannot get a two-way bind in WPF to work. I have a string
I cannot get the internet explorer web developer tool bar to work with a
I cannot get std::tr1::shared_ptr for my WinMobile project since the STL for WinCE is
For the life of me, I cannot get the SqlProfileProvider to work in an
For some reason, no matter how I go about it, I cannot get TortoiseSVN
I'm terribly new to SQL, and cannot seem to get the desired information out,
I get this message: Cannot find the X.509 certificate using the following search criteria:
I get this warning from GCC: warning: cannot pass objects of non-POD type 'class
I continue to get this error: Object '%s' cannot be renamed because the object
When I call Response.Redirect(someUrl) I get the following HttpException: Cannot redirect after HTTP headers

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.