将绘图对象添加到 UIWebView

发布于 2024-10-05 09:13:36 字数 95 浏览 0 评论 0原文

基本问题 - 我有一个加载了 pdf 文档的 UIWebView。

如何将绘图对象(例如符号)添加到此 UIWebview 的滚动视图层。

干杯

Basic question - I have a UIWebView with a pdf document loaded.

How can I add drawing objects (eg. a symbol) to this UIWebview's scrollView layer.

Cheers

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

白首有我共你 2024-10-12 09:13:36

试试这个。

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    

    [self.window makeKeyAndVisible];
    [web loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://tiny4.org"]]];
    UIScrollView* scrollView =  [[web subviews] objectAtIndex:0];
    web.backgroundColor = [UIColor clearColor];
    scrollView.backgroundColor = [UIColor clearColor];
    UILabel* label = [[UILabel alloc] initWithFrame:CGRectMake(0, 40, 100, 20)];
    label.text = @"testasdasdasda";
    [window addSubview:label];
    [window bringSubviewToFront:web];
}

try this.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    

    [self.window makeKeyAndVisible];
    [web loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://tiny4.org"]]];
    UIScrollView* scrollView =  [[web subviews] objectAtIndex:0];
    web.backgroundColor = [UIColor clearColor];
    scrollView.backgroundColor = [UIColor clearColor];
    UILabel* label = [[UILabel alloc] initWithFrame:CGRectMake(0, 40, 100, 20)];
    label.text = @"testasdasdasda";
    [window addSubview:label];
    [window bringSubviewToFront:web];
}
一笑百媚生 2024-10-12 09:13:36

我发现通过使用 UIWebViews UIScrollView 访问

UIScrollView *myWebScrollView = [[myWebView subviews] objectAtIndex:0];

我可以将对象添加到该层。结合 Mithin 的解决方案< /a> 用于挂钩点击事件,它允许完全控制内容......

I found that by accessing the UIWebViews UIScrollView using

UIScrollView *myWebScrollView = [[myWebView subviews] objectAtIndex:0];

I can add objects to this layer. In combination with Mithin's solution for hooking onto Tap-events, it allows full control of the content ...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文