由网友(心若一动泪就千行)分享简介:我如何在一个图像可点击(而不是整幅画面)的中间弄一个领域?试着用一个按钮设置为不可见和可点击,但按键不起作用。什么是替代不可见/透明按钮的工作原理就像一个普通的?How do I get one area in the middle of a image clickable (not the whole image)...
我如何在一个图像可点击(而不是整幅画面)的中间弄一个领域?试着用一个按钮设置为不可见和可点击,但按键不起作用。什么是替代不可见/透明按钮的工作原理就像一个普通的?
How do I get one area in the middle of a image clickable (not the whole image)? Tried with a button set to invisible and clickable but the button does not work. What are the alternatives to an invisible / transparent button that works like a regular?
我也想过一个完全透明,可点击PNG的应该工作,但也许不是最好的方法是什么?
I've also thought of a completely transparent and clickable PNG that should work but maybe not the best way?
推荐答案
在这里你去:
Button theButton = (Button)findViewById(R.id.theButton);
theButton.setVisibility(View.VISIBLE);
theButton.setBackgroundColor(Color.TRANSPARENT);
phoneButton.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View v)
{
// DO STUFF
}
});
相关推荐
最新文章