I would like to know how to make a button visible but when clicked I want it to be invisible so it won't be shown at all.
相关问题
- 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
you can do like this way.
This will be remove your button from your layout so other control will be used that space.
If you want to just hide and keep button size with another layout you can use
put this line in your
Button's on click method.
EDIT: if you make totally gone the Button view and then try
Just use this in your OnClickListener:
If you want it to be totally invisible and take up layout space use
It's quite simple.
setVisibility(View.Invisible)
insideOnClickListener()
of the buttonThis makes it go invisible but still take up space in the layout, switching the last row for:
would make it "fold" and it will not only be invisible but won't take up space in the layuout either.