简体   繁体   English

使Android应用程序更好地可点击

[英]Make android app better clickable

I have an icon in my application and I made it clickable (When I click the icon, some action is called), but the problem is, you have to be really accurate.我的应用程序中有一个图标并且我使它可点击(当我点击图标时,会调用一些操作),但问题是,你必须非常准确。 On the other hand the menu icon (the 3 dots) has a bigger "range" and when you click little bit outside, it is still working.另一方面,菜单图标(3 个点)有一个更大的“范围”,当你在外面点击一点点时,它仍然有效。 Is there any way to achieve the same thing at the app icon?有什么方法可以在应用程序图标上实现相同的功能吗? Or is there any better way to make a clickable icon in the upper left corner than using app icon?或者有没有比使用应用程序图标更好的方法在左上角制作可点击的图标?

添加padding的图标,更padding你添加到它,更可点击区域,你会得到!

Try to put a transparent button over your icon.尝试在您的图标上放置一个透明按钮。 Don't forget to make it unclickable and put enabled to false, so it doesn't intercepts the click intended for the icon.不要忘记将其设置为不可点击并将 enabled 设置为 false,这样它就不会拦截针对该图标的点击。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM