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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:32:21+00:00 2026-06-08T19:32:21+00:00

My custom dialog looks incorrect. Android cuts my buttons. I use next layout to

  • 0

enter image description here

My custom dialog looks incorrect. Android cuts my buttons.

I use next layout to display this dialog:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="280dp"
android:orientation="vertical"
android:padding="10dp">

<FrameLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/dialog_top"
    android:padding="0dp" >

    <TextView
        android:id="@+id/title"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_margin="5dp"
        android:ellipsize="end"
        android:gravity="center"
        android:maxLines="1"
        android:text="Title"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textColor="@android:color/white" />

</FrameLayout>

<FrameLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_marginTop="-2dp"
    android:background="@drawable/dialog_bottom"
    android:padding="0dp" >

    <LinearLayout 
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center" 
        android:orientation="vertical">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentTop="true"
            android:layout_marginBottom="10dp"
            android:text="Do you really want to close program?" />

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

            <Button
                android:id="@+id/yes"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginRight="10dp"
                android:background="@drawable/btn_orange_normal"
                android:minWidth="100dp"
                android:text="@string/yes" />

            <Button
                android:id="@+id/no"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dp"
                android:background="@drawable/btn_lightgray_normal"
                android:minWidth="100dp"
                android:text="@string/no" />

        </LinearLayout>

    </LinearLayout>

</FrameLayout>

To display my custom dialog I use next code:

   public CustomxDialog(Context context)
{
    super(context, R.style.My_Dialog);

    root = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.dialog, null);
    title = (TextView) root.findViewById(R.id.title);
    super.setContentView(root);
}

and R.style.My_Dialog is

 <style name="My.Dialog" parent="android:style/Theme.Dialog">
    <item name="android:textColor">@color/text_default</item>
    <item name="android:windowBackground">@android:color/transparent</item>
    <item name="android:windowNoTitle">true</item>
</style>

In layout editor all looklikes normal. Why Android shows incorrect my dialog?

  • 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-08T19:32:22+00:00Added an answer on June 8, 2026 at 7:32 pm

    Set a layout_height for the buttons:

    <Button
                android:id="@+id/yes"
                android:layout_width="wrap_content"
                android:layout_height="50dp"
                android:layout_marginRight="10dp"
                android:background="@drawable/btn_orange_normal"
                android:minWidth="100dp"
                android:text="@string/yes" />
    
            <Button
                android:id="@+id/no"
                android:layout_width="wrap_content"
                android:layout_height="50dp"
                android:layout_marginLeft="10dp"
                android:background="@drawable/btn_lightgray_normal"
                android:minWidth="100dp"
                android:text="@string/no" />
    

    50dp may be too large/small, play with the values until it’s right.

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

Sidebar

Related Questions

I've created custom dialog (from xml file), like below: <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=fill_parent android:orientation=vertical
I have a custom style file( style.xml ) in res/values that looks like this:
Anybody know how to use validation in custom search dialog that looks like validation
this is my custom dialog class: package com.WhosAround.Dialogs; import com.WhosAround.AppVariables; import com.WhosAround.R; import com.WhosAround.AsyncTasks.LoadUserStatus;
I have a custom Dialog that contains only a TextView to display some text
I have a custom dialog with one editText view and two buttons ok and
I have a basic custom dialog box for use with various controls in a
In my application I have a custom dialog which display some unwanted margin at
In my application I am displaying custom invite dialog. This is achived by using
When using a custom dialog in an Android App how is it then possible

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.