简体   繁体   English

如何在 android 中禁用 webview 中的特定按钮/链接

[英]How to disable a particular button/link in a webview in android

I am new to Android development.我是 Android 开发的新手。 Created a simple application with a webview.使用 webview 创建了一个简单的应用程序。 Webview loads a url. Webview 加载 url。 Now I want to disable only one button from the website.现在我只想禁用网站上的一个按钮。 How can I do that using the class name of the button?如何使用按钮的 class 名称来做到这一点?

you shouldn't.你不应该。 if you decided to make a web GUI then handle actions in "web" way (JS?).如果您决定制作 web GUI,则以“Web”方式(JS?)处理操作。 if you want to handle natively clicks and other actions (different gestures, scroll, etc.) then make native GUI with XML.如果您想处理本地点击和其他操作(不同的手势、滚动等),请使用 XML 制作本地 GUI。 making such hybrid as you decribed, while possible eg using JS interface for making communication web<->native sides , is waste of time and resources (for handling whole GUI, especially so basic actions like clicks or enablind/disabling items)像您描述的那样进行混合, 虽然可能,例如使用 JS 界面来制作通信 web<->native端,但浪费时间和资源(用于处理整个 GUI,尤其是诸如单击或启用/禁用项目之类的基本操作)

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

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