Hello! I want to create custom dialog. I want to use my png drawable
as background for it. I would like the background to be expandable
vertically and it would be good if it was of constant width. Another
requirement is that the top part of the drawable must be background
for the title and also mustn't expand (be of constant height).
So I create style like this:

    <style name="myDialogStyle" parent="android:Theme.Dialog">
        <item name="android:windowBackground">@drawable/dialog_bg</item>
    </style>

And in my activity:

setTheme(R.style.myDialogStyle);

In this case, if I use simple png, it expands with it's top part, so
that the last requirement is unsatisfied. It's reasonable to use 9-
patch in this case. But when I convert my drawable into 9-patch one, I
have to put dots not only for vertical expanding, but for the
horizontal one too. So I put a dot for vertical expanding below the
top part of picture and a dot for horizontal expanding at a random
place.
And now a strange problem occurs. The horizontally expandable (marked
by my dot) area gets expanded a bit and the content of my dialog
activity gets placed right in the horizontally expandable area, so
that this content becomes of a very small width. Furhtermore, the
title is shown below the place it is shown at in normal case and does
not match with the top part of drawable. All this looks quite awful.
I've found a way to return a normal width to content. I fill all the
upper line with dots in 9-patch for this. But this way seems ugly to
me and still it doesn't solve the problem with showing title lower
than it should be.

 Does anybody know how to solve these problems? Maybe any other ways
to set dialog background?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to