【问题标题】:iOS : jump to a specific slide in pptiOS:跳转到 ppt 中的特定幻灯片
【发布时间】:2013-02-26 07:45:52
【问题描述】:

我在本地有一个 ppt 文件,我用 UIWebView 打开下面的代码,文件有 10 张幻灯片,现在有要求,我想跳转到特定的幻灯片,比如如果我想直接跳转滑动#3 那么如何使用这段代码呢?

-(void)loadDocument:(NSString*)documentName inView:(UIWebView*)webView
{
    NSString *path = [[NSBundle mainBundle] pathForResource:documentName ofType:@"ppt"];
    NSURL *url = [NSURL fileURLWithPath:path];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [webView loadRequest:request];
}

//open ppt into UIWebView like,
[self loadDocument:@"newone" inView:self.myWebview];

我在这里搜索,发现this,他们在做

链接到http://www.whatever.com/hello.ppt#4 以便最初打开幻灯片 4。

但我的 ppt 文件保存在我的应用程序内的文档目录(本地)中。

有什么建议吗?

【问题讨论】:

    标签: ios uiwebview powerpoint


    【解决方案1】:

    您可以设置UIWebviewScrollView 的偏移量。

    [[webView scrollView] setContentOffset:CGPointMake(widht, height) animated:YES];
    

    在当前缩放比例中查找一张幻灯片的高度。将其乘以第四页以最初打开。并在上面的代码中加入点 CGPointMake(0, heightYouCalculated)

    【讨论】:

      猜你喜欢
      • 2023-02-10
      • 2011-02-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-09-05
      • 2017-09-17
      相关资源
      最近更新 更多