Skip to content

Instantly share code, notes, and snippets.

@cblunt
Created May 9, 2012 10:15
Show Gist options
  • Save cblunt/2643546 to your computer and use it in GitHub Desktop.
Save cblunt/2643546 to your computer and use it in GitHub Desktop.
Android: Custom Styled Dialog without border or title
public void showCustomDialog() {
Dialog dialog = new Dialog(this, R.style.Theme.CustomDialog);
dialog.setContentView(R.layout.custom_dialog);
// ...
dialog.show();
}
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/ic_add"
android:text="@string/my_button_label"/>
</LinearLayout>
<style name="Theme.CustomDialog" parent="@android:style/Theme.Translucent.NoTitleBar">
<item name="android:windowIsFloating">true</item>
<item name="android:windowNoTitle">true</item>
<item name="android:padding">10dp</item>
<item name="android:background">#ff90ff90</item>
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment