iPhone 浏览器开发之关键 UIWebView
2010-03-24 16:20:00 来源:WEB开发网NSLog(@"loading");
UIView *contentView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
contentView.backgroundColor = [UIColor blueColor];
NSLog(@"self view");
// view orientation rotation
contentView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
self.view = contentView;
//设置属性
//自动调整视图大小
self.view.autoresizesSubviews = NO;
//
//创建一个层用来放webview
CGRect webFrame = [[UIScreen mainScreen] applicationFrame];
webFrame.origin.y -= 20.0;
//
UIWebView *aWebView = [[UIWebView alloc] initWithFrame:webFrame];
self.webView = aWebView;
//缩放
aWebView.scalesPageToFit = NO;
//自动调整大小
aWebView.autoresizesSubviews = NO;
aWebView.autoresizingMask=(UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth);
//[aWebView setDelegate:self];
NSURL *aURL = [NSURL URLWithString:@"http://192.168.1.120/emenu/?tp=tp4"];
NSURLRequest *aRequest = [NSURLRequest requestWithURL:aURL];
//发送请求
[aWebView loadRequest:aRequest];
//把webview添加到内容视图
[contentView addSubview:webView];
[aWebView release];
[contentView release];
- ››浏览器Cookie:一半广告 一半隐私
- ››开发Android 日历教程
- ››开发学院总结 Win 8实用技巧大全
- ››开发学院原创教程:把win8的IE10放桌面上方法(非...
- ››iphone图片拉伸的几种方法
- ››iphone正则表达式的简单使用
- ››iPhone开发Unresolved Symbols CAKeyframeAnimati...
- ››IPhone开发-“此证书是由未知颁发机构签名”解决方...
- ››IPhone开发-整合私钥和证书,生成.p12文件
- ››iPhone应用开发-UIPickerView选取器详解
- ››iphone 获取屏幕的宽度和高度
- ››iPhone读取工程包中的二进制文件
更多精彩
赞助商链接