2

I want my activity to look like a dialog.

Well, I achieved that using android:theme="@android:style/Theme.Dialog" Now, I also want it to be translucent as it appears in android:theme="@android:style/Theme.Translucent"

Is there a a way to mix them both using a custom style?? Please any suggestions, thanks

EDIT: achieved something similar with this: Now i want to add border like a dialogwindow...how can i do that???

<style name="TransparentDialog" parent="@android:style/Theme.Dialog"> <item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowFrame">@android:color/transparent</item> <item name="android:windowContentOverlay">@null</item> <item name="android:windowIsFloating">true</item> <item name="android:backgroundDimEnabled">true</item> <item name="android:windowIsTranslucent">true</item> <item name="android:alertDialogStyle">@android:style/Theme.Dialog</item> <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item> </style> 

EDIT: Solved this. Check the answer

2 Answers 2

4

Finally achieved what i wanted with this:

Used this theme for my activity android:theme="@android:style/Theme.Translucent"

and gave this android:background="@android:drawable/dialog_frame"as background to the root element of my layout

That was so easy!

Sign up to request clarification or add additional context in comments.

Comments

1

You'll need to combine the two themes together. One thing that might work is:

<style name="TranslucentDialog" parent="@android:style/Theme.Dialog"> <item name="android:background">"#33000000"</item> </style> 

2 Comments

Um, it works for me. Are you sure you're applying the TranslucentDialog style to your activity?
no...stil not working...m applyng what u said check edited question

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.