在Android上浮动:如何适应屏幕尺寸 [英] flot on android: how to fit the screen size

查看:127
本文介绍了在Android上浮动:如何适应屏幕尺寸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用flot在Webview上绘制某些内容,但很难根据屏幕尺寸使图形很好地适合.似乎只接受绝对尺寸,当我将其更改为相对尺寸时,该图形消失了:

I'm trying to use flot to plot something on the webview but hard to get the figure to fit nicely according to the screen size. It seems that only absolute size is accepted, while I change it to relative, the figure disappeared:

<div id="placeholder" style="width:80%;height:40%;"></div>

您可以从其他人那里尝试一个示例:

An example you can try is here from someone else: Using Flot's Bar Graph in an Android WebView with Highlighting

推荐答案

问题已解决.我必须使用设备宽度:

problem solved. I have to use the device-width:

<div id="graphHolder" STYLE="height:200px;width:device-width"></div>

感谢如何设置Android中条形图的设备高度和宽度

这篇关于在Android上浮动:如何适应屏幕尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆