在 Cocoa 中缩放 WebView [英] Scale WebView in Cocoa

查看:28
本文介绍了在 Cocoa 中缩放 WebView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何缩放 WebView 的内容?

How can I scale the content of a WebView?

推荐答案

您需要在要调整大小的单个框架(例如主框架)的文档视图上调用 -scaleUnitSquareToSize::

You need to call -scaleUnitSquareToSize: on the document view of the individual frame that you want to resize, for example the main frame:

[[[[webView mainFrame] frameView] documentView] scaleUnitSquareToSize:NSMakeSize(1.5, 1.5)];
[[[[webView mainFrame] frameView] documentView] setNeedsDisplay:YES];

这篇关于在 Cocoa 中缩放 WebView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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