我可以增强按钮的触摸灵敏度吗?
我正在开发一个应用程序,这里有两个按钮,用于导航应用程序中的故事,例如下一个和上一个按钮。它们没有被正确点击,我的意思是我必须点击它们两次或三次才能使它们在设备上工作。无论如何,我可以提高按钮的灵敏度,以便只需轻轻一按即可工作。如有任何建议和帮助,我们将不胜感激。
I am working on an app, here i have two button, which navigate through the stories in my app, say next and previous buttons. They are not tapped properly, i mean i have to tap them twice or thrice to make them work on device. Is there anyway that i can increase the sensitivity of the buttons so that the work on just one tap. Any Suggestions and help is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用
RelativeLayout
和 10-15 dp 的 Paddings/Margins 来包围每个Button
并将触摸监听器注册到RelativeLayout
而不是Button
。Use
RelativeLayout
s, with 10-15 dp of Paddings/Margins to enclose each of theButton
s and register the touch listener to theRelativeLayout
s instead of theButton
s.这与设备上其他地方的按钮行为有什么不同吗?如果是这样,那么您在应用程序中做了一些奇怪的事情,导致了一些问题。如果不是,那么这只是您的设备工作方式的问题,您几乎不需要做任何事情就可以使应用程序中的按钮表现不同。
您可以做的一件事是将开发 (DevTools) 应用程序放在您的设备上,然后打开指针位置以在屏幕上查看正在生成的实际指针事件。
Is this different from the behavior of buttons elsewhere on your device? If so, you have done something strange in your app that has broken things. If not, then this is just an issue with how your device works and there is little you are likely to be to do to make the buttons in your app behave differently.
One thing you can do is put the Development (DevTools) app on your device and turn on Pointer Location to see on your screen the actual pointer events being generated.