Created
May 9, 2012 10:15
-
-
Save cblunt/2643546 to your computer and use it in GitHub Desktop.
Android: Custom Styled Dialog without border or title
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void showCustomDialog() { | |
Dialog dialog = new Dialog(this, R.style.Theme.CustomDialog); | |
dialog.setContentView(R.layout.custom_dialog); | |
// ... | |
dialog.show(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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