Clickable Hidden Button or Image

試著忘記壹切 提交于 2019-12-13 04:07:23

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!