How to get that cross button/image (red circled) on Custom dialog box's boundary?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
this is the code inside your activity
this is the custom_dialog.xml
declare somewhere private AlertDialog alertDialog;....
Hope this help you.
Android is not Windows. You don't need a Windows style 'Close' button. Also, Android is not MacOS, so you don't need a little shiny red candy-like dot either.
When you develop an app for a mobile platform you should conform to the User Interface Guidelines that define the usage patterns and visual styles of that platform.
Android does not have title bars, does not have dropdown menus, and does not have minimize/restore/close buttons. Don't try to make them, or you will make an app that looks like it was never meant for the Android Platform.
The "Back" hardkey is the button that does exactly what you want. It closes a dialog without making a selection. Let the Android platform do the same thing here. Don't force your users to think in another OS than the one they use.
HI,
you have to follow these steps to make this Custom dialog box.
create a xml file style.xml in your values folder. and enter style in your resource tag.
create a custom_dialog.xml in layout folder.
finally access this layout in an activity it will work.
I did some work on that here is code tested on nuxes 5, the cross in attached image is an image
dialog.xml
Layout rounded_border.xml
Inside dialog class in onCreate method
Demonstration