Hi, I use a custom view for an AlertDialog. In the emulator, there is some
space above and below the customeView. If I set a title and buttons for the
AlertDialog, I can see the space between the title panel/button panel and
the customView.

<http://mono-for-android.1047100.n5.nabble.com/file/n5713017/AlertDialog.jpg> 

My code to open the AlertDialog:

            btnShowDialog.Click += (object sender, EventArgs e) =>
            {
                var customView =
LayoutInflater.Inflate(Resource.Layout.myDialog, null);
                var builder = new AlertDialog.Builder(this);
                builder.SetTitle("Title");
                builder.SetView(customView);

                builder.Create().Show();
            };

The customView layout:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android";
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="#FFFFFF">
    <TextView
        android:id="@+id/DialogText"
        android:text="This is my custom view. Blur Blur Blur"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content" />
    <EditText
        android:id="@+id/EnterPhone"
        android:inputType="phone"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:hint="enter your number" />
</LinearLayout>

I have tested the AlertDialog in android 4.0.3 and 4.1.2 emulator and get
the same issue.


Thanks for help!



--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/In-AlertDialog-how-to-remove-the-space-above-and-below-the-cusomview-tp5713017.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
[email protected]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to