I need to create a dialog over a fragment (which occupies the entire screen). The dialog should be a floating dialog, which will be located above the fragment with the fragment darkened outside the fragment.
For a user dialog, I have a linearLayout with curved edges, no matter what I do, the dialog has black bordering on all sides (very small). I tried everything to make it transparent and go away (so the whole dialog box is just a linear layout - a curved block)
For DialogFragment, this is what I have for onCreateView
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){ LinearLayout layout =(LinearLayout)inflater.inflate(R.layout.custom_dialog, null); LinearLayout item = (LinearLayout)layout.findViewById(R.id.display_item); populateItemData(item, inflater); return layout; }
custom_dialog is just a LinearLayout that has an android: backgroung is set to # 000000
This is my style for user dialogue.
<style name="CustomDialog" parent="android:style/Theme.Dialog"> <item name="android:windowBackground">@null</item> <item name="android:windowNoTitle">true</item> <item name="android:windowIsFloating">true</item> <item name="android:windowIsTranslucent">true</item> <item name="android:alwaysDrawnWithCache">false</item> <item name="android:windowContentOverlay">@null</item> </style>
I tried all kinds of combinations in this style (from what I saw on the Internet), and I canβt get rid of this annoying black border, I can draw it white or any other color if I set this LinearLayout background to anything but # 000000 ...
I spent literally 3-4 hours on this, I hope someone else can help ...
android android-layout android-fragments android-dialogfragment android-dialog
Tolga E Nov 08 '11 at 3:20 2011-11-08 03:20
source share