zoukankan      html  css  js  c++  java
  • 2016-02-20 web view

      

    #import "MedDetitleViewController.h"

    @interface MedDetitleViewController ()<UIScrollViewDelegate,UIWebViewDelegate>{

        UIImageView *imagershujuMed;

        UILabel *tiwuxianLabmed;

        UIScrollView *scrviewll;

        

        UIWebView  *webvieww1111;

    }

    @end

    @implementation MedDetitleViewController

    - (void)viewDidLoad {

        [super viewDidLoad];

        self.view.backgroundColor = [UIColor whiteColor];

    //    NSString *Strsubit =self.MedDetalDic[@"name"];

    //    NSString *Sttit ;

    //    if (Strsubit.length>7) {

    //        Sttit =[NSString stringWithFormat:@"%@...",[Strsubit substringToIndex:7]];

    //    }

    //    else{

    //        

    //        Sttit = Strsubit;

    //    }

    //    

    //    

    //    self.title=Sttit;

    //    

         self.title=@"药品说明";

        [self navBarUi];

        

        UIWebView *viewWeb = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];

        webvieww1111=viewWeb;

        viewWeb.backgroundColor = [UIColor whiteColor];

        viewWeb.delegate =self;

        

        [self.view addSubview:viewWeb];

        

        

        

        

        [self showTishi11];

        

        NSString *path=[NSString stringWithFormat:@"%@",_MedDetalDic[@"htmlPath"]];

        NSString *url = [NSString stringWithFormat:@"%@%@",ImageUrl,path];

    //

    //    

        [viewWeb loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];

    //    NSLog(@" =url=%@",url);

        

        if ([_MedDetalDic count]<=0||_MedDetalDic==nil) {

            imagershujuMed.hidden = NO;

            tiwuxianLabmed.hidden = NO;

        }else{

            imagershujuMed.hidden = YES;

            tiwuxianLabmed.hidden = YES;

        }

    }

    -(void)navBarUi{

        UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"gdback3"] originalImage] style:UIBarButtonItemStylePlain target:self action:@selector(backClickMedicine)];

        self.navigationItem.leftBarButtonItem=backItem;

        //自定义后退按钮后,手势返回上一级控制器的功能恢复

        self.navigationController.interactivePopGestureRecognizer.delegate = nil;

    }

    //提示

    -(void)showTishi11{

        

        //1210

        

        imagershujuMed = [[UIImageView alloc]initWithFrame:CGRectMake(SCREEN_WIDTH/2-ImagerWuWidth/2, SCREEN_HEIGHT/2-ImagerWuheight/2, ImagerWuWidth, ImagerWuheight)];

        imagershujuMed.image = [UIImage imageNamed:@"zanwushuju1"];

        imagershujuMed.hidden = YES;

        

        [scrviewll addSubview:imagershujuMed];

        

        

        tiwuxianLabmed = [[UILabel alloc]initWithFrame:CGRectMake(SCREEN_WIDTH/2-TishiLabwidth/2, CGRectGetMaxY(imagershujuMed.frame), TishiLabwidth, 30)];

        tiwuxianLabmed.text = @"暂无数据";

        tiwuxianLabmed.textAlignment = YES;

        tiwuxianLabmed.textColor = RGB(188, 188, 188);

        tiwuxianLabmed.hidden = YES;

        tiwuxianLabmed.font = SYSTEMFONT(TishiLabFont);

        [scrviewll  addSubview:tiwuxianLabmed];

    }

    //返回上一级界面

    -(void)backClickMedicine{

         [self.navigationController popViewControllerAnimated:YES];

    }

    - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error

    {

            UIAlertView *alterview = [[UIAlertView alloc] initWithTitle:@"" message:[error localizedDescription]  delegate:nil cancelButtonTitle:nil otherButtonTitles:@"OK", nil];

            [alterview show];

        

    }

    - (void)webViewDidStartLoad:(UIWebView *)webView

    {

        //    [activityIndicatorView startAnimating] ;

        [MBProgressHUD  showHUDAddedTo:self.view animated:YES];

    }

    - (void)webViewDidFinishLoad:(UIWebView *)webView

    {

        //    [activityIndicatorView stopAnimating];

        [MBProgressHUD hideHUDForView:self.view animated:YES];

    }

    @end

  • 相关阅读:
    std::copy 多次赋值 偏移 内存分配
    chromium http 处理
    c++ 智能指针 传参
    最简单的gn构建 脱离chromium
    简单的nodejs httpserver
    C语言跨文件调用变量方法
    使用node压缩js
    Jmeter压力测试工具安装及使用教程
    前端常见跨域解决方案(全)
    QuickApp 快应用中 或 nodejs 中 API接品调用时 GBK转UTF8
  • 原文地址:https://www.cnblogs.com/gzz2016/p/5203693.html
Copyright © 2011-2022 走看看