开发者

How to create a fully customized Alert Dialog?

Is there a solution to create an Alert Dialog with no borders around? If I create a layout and attach it to the Alert Dialog, I have my layout shown, but it's surrounded by the default dialog borders. Any way to cut them off? Thanks in advance开发者_JAVA技巧.


Here is one way (if you don't like this particular example with the green border, scroll below to see a second one I found).

How to create a fully customized Alert Dialog?

How to create a fully customized Alert Dialog?

Here is another example (this one gives you an example without a border, and one with a border. The explanations are in Japanese, but the code is given for both.)

How to create a fully customized Alert Dialog?

How to create a fully customized Alert Dialog?


Hi if you use your own layout then set this in your styles.xml

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

</style>

and set this style in your manifest file

<activity android:name=".Main" android:theme="@style/Theme.Transparent_layout" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜