This example shows a dialog approach to black edges in Android. And it is divided into two kinds of methods: preserving shadow and not preserving shadow. For reference. The implementation methods are as follows:
1. Do not preserve shadows
The code is as follows:
<?xml version= "1.0" encoding= "Utf-8"?> <resources> <style name= "dialog" parent= "
@android: Style/theme.dialog "><!--name is the hallmark of the resources we use when using, and parent refers to the-->
<item name=" Android, which inherits the current style. Windowframe "> @null </item>
<item name=" android:windowisfloating ">true</item>
< Item Name= "Android:windowistranslucent" >false</item>
<item name= "Android:windownotitle" >true </item><!--Hide title bar-->
<item name= "Android:background" > @color/clarity</item>
< Item Name= "Android:windowbackground" > @drawable/clarity</item>< It's important here, too, I've used a transparent. 9.png diagram, of course. 00000000 is also possible, otherwise the word here comes out with a black background-->
<item name= "android:backgrounddimenabled" >false</item>
</style>
</resources>
2. Preserve Shadows
The code is as follows:
<resources>
<style name= "dialog" parent= "@android: Style/theme.dialog" >
<item name= "Android : Windowframe "> @null </item>
<item name=" Android:windownotitle ">true</item>
<item Name= "Android:windowbackground" > @null </item>
</style>
</resources>
Final Dialog Dialog = new Dialog (context, r.style.dialog);
Dialog.setcontentview (view);
Dialog.show ();
I hope the code described in this article will help you with your Android program.