• 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

  • 相关阅读:
    《.NET内存管理宝典 》(Pro .NET Memory Management) 阅读指南
    《.NET内存管理宝典 》(Pro .NET Memory Management) 阅读指南
    《.NET内存管理宝典 》(Pro .NET Memory Management) 阅读指南
    使用Jasmine和karma对传统js进行单元测试
    《.NET内存管理宝典 》(Pro .NET Memory Management) 阅读指南
    《.NET内存管理宝典 》(Pro .NET Memory Management) 阅读指南
    nginx 基于IP的多虚拟主机配置
    Shiro 框架的MD5加密算法实现原理
    项目实战:Qt+OSG三维点云引擎(支持原点,缩放,单独轴或者组合多轴拽拖旋转,支持导入点云文件)
    实用技巧:阿里云服务器建立公网物联网服务器(解决阿里云服务器端口,公网连接不上的问题)
  • 原文地址:https://www.cnblogs.com/gzz2016/p/5203693.html
Copyright © 2020-2023  润新知