【问题标题】:iOS webview - Loading multiple filesiOS webview - 加载多个文件
【发布时间】:2013-03-23 13:27:46
【问题描述】:

我是 iOS 新手.. 我创建了一个简单的应用程序,使用UIWebview,我正在从服务器加载一个文件夹,其中包含 4 个子文件夹(1. CSS 2. Images 3. Audio 4. Html files),我想在webview 中显示 Html Files 文件夹中的第一个文件 html 文件,然后当用户滑动页面时,我想显示 Html 文件文件夹中的下一个 html 文件.. 这里有可能.. 我我是 iOS 新手,请帮助我。

【问题讨论】:

    标签: iphone ios uiwebview


    【解决方案1】:

    滑动效果

    这是一个基本代码sn-p:

    UISwipeGestureRecognizer *mSwipeUpRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(doSomething)];
    
    [mSwipeUpRecognizer setDirection:(UISwipeGestureRecognizerDirectionUp | UISwipeGestureRecognizerDirectionDown | UISwipeGestureRecognizerDirectionLeft | UISwipeGestureRecognizerDirectionRight)];
    
    [webview addGestureRecognizer:mSwipeUpRecognizer];
    
    [mSwipeUpRecognizer release];
    

    并在 .h 文件中添加:

    <UIGestureRecognizerDelegate>
    

    现在在 doSomething 方法实现中,更改您的网络 NSURL 并将该 URL 再次加载到网络视图。

    对于卷曲动画:

    以下是一些示例链接:

    How to give page curl animation in webView?

    Turn a page (a UIWebView) with an animation

    【讨论】:

    • 谢谢 mrunal.. 我可以像 Curl 页面那样做吗..?
    • 如何在 webview 中一一加载文件...我在 bundle 中有文件夹
    • 使用 bundle 中的文件路径创建 NSURL 对象,然后使用。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-28
    • 2016-01-18
    相关资源
    最近更新 更多