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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:04:12+00:00 2026-05-23T23:04:12+00:00

I am creating a custom dialog in my app and it looks fine in

  • 0

I am creating a custom dialog in my app and it looks fine in the Layout Editor, but is not the right size on the device. Here’s the layout for the dialog:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:background="@drawable/dialog_border"
    android:paddingLeft="20dp"
    android:paddingRight="20dp"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">
    <ImageView
        android:id="@+id/image"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_centerHorizontal="true"
        android:padding="10dp"
        android:src="@drawable/wifi" />
    <TextView
        android:layout_height="wrap_content"
        android:id="@+id/heading"
        android:layout_below="@+id/image"
        android:layout_width="wrap_content"
        android:layout_margin="10dp"
        android:layout_alignLeft="@+id/cancel_button"
        android:layout_alignRight="@+id/continue_button"
        android:gravity="center"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:text="@string/lost_connection"
        android:layout_centerHorizontal="true" />
    <TextView
        android:layout_height="wrap_content"
        android:id="@+id/description"
        android:layout_width="wrap_content"
        android:layout_below="@+id/heading"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:layout_centerHorizontal="true"
        android:layout_alignLeft="@+id/cancel_button"
        android:layout_alignRight="@+id/continue_button"
        android:gravity="center"
        android:layout_margin="10dp"
        android:text="@string/try_again" />
    <Button
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_toRightOf="@+id/cancel_button"
        android:layout_below="@+id/description"
        android:layout_centerHorizontal="true"
        android:id="@+id/dismiss_button"
        android:text="@string/dismiss" />
</RelativeLayout>

This is what it looks like in the Layout Editor:
Layout Editor

But this is what it looks like on the device:
Device

It has that weird bit of extra space at the top and right side and the button is compress vertically.

  • 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-23T23:04:13+00:00Added an answer on May 23, 2026 at 11:04 pm

    I think that extra weird space at the top is the place for the dialog title. As i see on the screenshots you used a dialog and inflated a custom view into that dialog ?

    I guess worth a try to hide the title of the dialog with yourDialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);

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

Sidebar

Related Questions

I have followed a few tutorials on creating a custom property editor dialog, but
I am creating Relative Layout which looks fine not giving any error at that
I want to add a custom Dialog, but I have problems creating a xml
I have a problem creating a custom dialog. But I don't find the failure.
I am creating a custom dialog as: Dialog myDialog = new Dialog(context, R.style.Theme_Levels); myDialog.setContentView(R.layout.levelselector);
I tried the following code for creating a custom progress dialog. But I am
i'm currently creating a custom dialog (alertdialog is not flexible enough for my needs).
Jython is great for creating custom data structures on need basis, but how to
I m creating custom checkbox and radio button in pure css but they are
I've tried creating my own version of a UIPickerView element for MonoTouch Dialog, but

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.