
这是同一页面的2个截图:
One from Galaxy Nexus (Android 4.3)
@L_301_2@
你知道在webvIEw中是否有一个新的选项来适应文字与屏幕?
注意:我不认为我的布局与我的问题有关,但在这里呢?
<relativeLayout xmlns:androID="http://schemas.androID.com/apk/res/androID" androID:layout_wIDth="match_parent" androID:layout_height="match_parent" androID:orIEntation="vertical" > <WebVIEw androID:ID="@+ID/webvIEw" androID:layout_wIDth="match_parent" androID:layout_height="match_parent" /></relativeLayout>解决方法 看起来这是使用NARROW_ColUMNS.这是在KitKat的 deprecated.
但是,添加了一种新的布局算法,可以解决这个问题,这里有一个例子:
https://github.com/GoogleChrome/chromium-webview-samples
主要代码是:
// Use WIDeVIEwport and Zoom out if there is no vIEwport definedsettings.setUseWIDeVIEwPort(true);settings.setLoaDWithOverviewmode(true);settings.setLayoutAlgorithm(LayoutAlgorithm.TEXT_autosizing);
另一个选项是启用压缩缩放:
// Enable pinch to zoom without the zoom buttonssettings.setBuiltInZoomControls(true);if(Build.VERSION.SDK_INT > Build.VERSION_CODES.HONEYCOMB) { // HIDe the zoom controls for HONEYCOMB+ settings.setdisplayZoomControls(false);} 新的布局算法可能无法解决所有问题,并不清楚如何可靠地模拟旧的包装行为.
大多数反对意见似乎是在移动设备上显示桌面版网站的一般浏览器问题.他们喜欢旧的方式,但是我还没有看到另外一个浏览器执行了文本包装算法正在做的事情.
总结以上是内存溢出为你收集整理的android – 如何使文本适合屏幕(文本换行)在WebView与KitKat全部内容,希望文章能够帮你解决android – 如何使文本适合屏幕(文本换行)在WebView与KitKat所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)