简体   繁体   English

单选按钮样式未显示在WebView中

[英]Radio button styles not showing in webview

I designed some radio buttons with images using css, because I want to make the radio button look bigger. 我使用CSS设计了一些带有图像的单选按钮,因为我想使单选按钮看起来更大。

Now, when I load it in browsers it works fine, same in mobile browsers. 现在,当我在浏览器中加载它时,它在移动浏览器中可以正常工作。 But when I try to load it in webview the radio button is not visible. 但是,当我尝试将其加载到webview中时,单选按钮不可见。 Is there anyway to enable css? 反正有启用CSS?

You don't need to enable css. 您无需启用CSS。 You just link to it from you html file like you normally would 您只需像通常那样从html文件链接到它

if your css file is separate then you need to provide complete relative path in html page you include the html page like file:/// something like that. 如果您的css文件是单独的,那么您需要在html页面中提供完整的相对路径,您应该在html页面中添加类似file:///之类的东西。

mobile brower can take relative path by itself like say your accessing from wampserver but if you are putting all in webview and loading then it dont take relative path by itself. 移动浏览器本身可以采取相对路径,例如说您从wampserver进行访问,但是如果您将所有内容都放在webview中并进行加载,则移动浏览器本身不会采取相对路径。 By the way where you are putting all this files in assests or sdcard ? 顺便说一句,您将所有这些文件放在assests或sdcard中?

将html,css和图像资源文件放在项目的资产文件夹中,并使用“ file:///android_asset/yourwebpage.html”作为网址加载html。

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

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