• UIWebView的使用---safri


    一、使用官方safri导入#import <SafariServices/SafariServices.h>

    //可以当webView来使用,里面的逻辑都不需要自己去实现 
    SFSafariViewController *view = [[SFSafariViewController alloc] initWithURL:[NSURL URLWithString:url]];
      UITabBarController *tabTar = (UITabBarController *)self.window.rootViewController;
        [tabTar.selectedViewController presentViewController:view animated:YES completion:nil];

     二、自己添加个web控制器和下面添加toolBar(上面放的是toolBarItem)

    @interface BSWebViewController ()<UIWebViewDelegate>
    @property (weak, nonatomic) IBOutlet UIWebView *webView;
    @property (weak, nonatomic) IBOutlet UIBarButtonItem *faword;
    @property (weak, nonatomic) IBOutlet UIBarButtonItem *goBack;
    @end
    @implementation BSWebViewController
    - (void)viewDidLoad {
        [super viewDidLoad];
        [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.url]]];
        self.webView.delegate = self;
    }
    - (IBAction)forward:(UIBarButtonItem *)sender {
        [self.webView goForward];
    }
    - (IBAction)goBack:(UIBarButtonItem *)sender {
        [self.webView goBack];
    }
    - (void)webViewDidFinishLoad:(UIWebView *)webView{
        self.faword.enabled = webView.canGoForward;
        self.goBack.enabled = webView.canGoBack;
    }
    

     h

    上面放上的webview,下面就是toolBar

    将来的自己,会感谢现在不放弃的自己!
  • 相关阅读:
    SLS评测报告
    Flash对不同的浏览器的兼容性
    NodeJS的Cluster模块使用
    Varnish+Xcache构建高性能WEB构架初探
    Memcached Client的释疑
    Firebug及YSlow简介与使用图文详解
    PHP Memcached 实现简单数据库缓存
    PHP + Memcache 实现Session共享
    Linux 开机关机在线求助与指令输入
    Linux 基础学习篇笔记 Linux基础知识
  • 原文地址:https://www.cnblogs.com/TheYouth/p/6535850.html
Copyright © 2020-2023  润新知