问题
In android is there anything thing like we can create a hidden button or image and it is still clickable.or alternately is there any way to achieve this functionality in Android. In ios we have the benefit of placing a clickable hidden button.
回答1:
Everything can be achieved in Android
<Button...
android:background="@null">
回答2:
Probably use a transparent Image to the button.
回答3:
You can make the button transparent or translucent by using the background property:
android:background="#ARGB"
where A is the transparency, which can be set between 0-F i.e., 0 means transparent and F means opaque. The remaining colours are R-Red, G-Green, B-Blue. so an eg. might be:
android:background="#200B"
which gives a tinge of blue colour.
This way you can provide transparency as well as a tinge of transparent colour to your view. This works with any view.
Also you can apply this through code:
button.setBackgroundColour(0x220000BB);
来源:https://stackoverflow.com/questions/11688282/clickable-hidden-button-or-image