Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/97.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 如何将文件上载到UIWebview_Iphone_Ios_Ipad - Fatal编程技术网

Iphone 如何将文件上载到UIWebview

Iphone 如何将文件上载到UIWebview,iphone,ios,ipad,Iphone,Ios,Ipad,您好,我有一个在UIWebview上运行的url,我有一个浏览选项,可以从中选择照片、pdf等文件 但当我运行UIWebview并单击browse按钮时,它会给出类似的豁免 " WebViewTutorial[1173:c07] Unbalanced calls to begin/end appearance transitions for <UIFileUploadFallbackRootViewController: 0x75a7330>." 提前感谢您如何介绍WebViewC

您好,我有一个在UIWebview上运行的url,我有一个浏览选项,可以从中选择照片、pdf等文件

但当我运行UIWebview并单击browse按钮时,它会给出类似的豁免

" WebViewTutorial[1173:c07] Unbalanced calls to begin/end appearance transitions for <UIFileUploadFallbackRootViewController: 0x75a7330>."

提前感谢

您如何介绍
WebViewController
本身?在导航控制器、选项卡等中?无法在iOS5和更早版本的web视图中上载文件(这可能在iOS6中得到支持,但我不可能对未发布的测试版功能发表评论;-)。WWDC宣布可以在iOS6中上载图片,但没有公开的信息说明其工作原理
#import "WebViewController.h"


    @implementation WebViewController

    @synthesize webView;

    - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
        if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
            // Initialization code
        }
        return self;
    }

    - (void)viewDidLoad {

        NSString *urlAddress = @"http://html5basicuploader.agnozine.com";

        //Create a URL object.
        NSURL *url = [NSURL URLWithString:urlAddress];

        //URL Requst Object
        NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];

        //Load the request in the UIWebView.
        webView.scrollView.scrollEnabled = NO;
        webView.scrollView.bounces = NO;
        [webView loadRequest:requestObj];

                webView.delegate = self;


    }


    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
        // Return YES for supported orientations
        return (interfaceOrientation == UIInterfaceOrientationPortrait);
    }


    - (void)didReceiveMemoryWarning {
        [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview
        // Release anything that's not essential, such as cached data
    }

    - (void)webViewDidFinishLoad:(UIWebView *)webView1{

        if([[UIDevice currentDevice] userInterfaceIdiom]==UIUserInterfaceIdiomPad )
        {


            [webView1 stringByEvaluatingJavaScriptFromString:@"document. body.style.zoom = 3.2;"];
            NSString* javascript = [NSString stringWithFormat:@"window.scrollBy(30, 0);"];
            [webView1 stringByEvaluatingJavaScriptFromString:javascript];
            webView.scalesPageToFit=NO;}
        else if ([[UIDevice currentDevice] userInterfaceIdiom]==UIUserInterfaceIdiomPhone){

            [webView1 stringByEvaluatingJavaScriptFromString:@"document. body.style.zoom = 1.2;"];
            NSString* javascript = [NSString stringWithFormat:@"window.scrollBy(0, 0);"];
            [webView1 stringByEvaluatingJavaScriptFromString:javascript];
            webView.scalesPageToFit=NO;}

    }

    - (void)dealloc {
        [webView release];
        [super dealloc];
    }


    @end