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];
- ››开发学院教你用SQL 语句最快速清空MySQL 数据表的...
- ››iPhone应用帮助残障儿童看图说话
- ››iPhone实用工具AppBox Pro使用教程大揭秘
- ››iphone4省电方法
- ››iphone 获取地址的详细信息
- ››iPhone 库的基本内存管理策略
- ››iPhone加密文字亲手做 私密信息有保障
- ››iphone 根据经纬度坐标取详细地址(包括国,省,市...
- ››iphone/ipad ios cocoa object-c 近期苹果UI部分小...
- ››iphone中如何进行多线程编程
- ››iPhone OS SDK的这些事[安装、下载、版本、实例、...
- ››iPhone ObjectC的NSAutoreleasePool
更多精彩
赞助商链接