首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Iphone >

iPhone SDK Examples(1)

2012-09-03 
iPhone SDK Examples(一)以下均为使用到Xib文件,其中原因大家应当都知道,不再赘述。1、显示图像Image View1.

iPhone SDK Examples(一)

以下均为使用到Xib文件,其中原因大家应当都知道,不再赘述。
1、显示图像Image View

   1. CGRect myImageRect = CGRectMake(0.0f, 0.0f, 320.0f, 109.0f);   2. UIImageView *myImage = [[UIImageView alloc] initWithFrame:myImageRect];   3. [myImage setImage:[UIImage imageNamed:@"myImage.png"]];   4. myImage.opaque = YES; // 设置不透明度   5. [self.view addSubview:myImage];   6. [myImage release];
?

2、Web view

   1. CGRect webFrame = CGRectMake(0.0, 0.0, 320.0, 460.0);   2. UIWebView *webView = [[UIWebView alloc] initWithFrame:webFrame];   3. [webView setBackgroundColor:[UIColor whiteColor]];   4. NSString *urlAddress = @"http://www.google.com";   5. NSURL *url = [NSURL URLWithString:urlAddress];   6. NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];   7. [webView loadRequest:requestObj];   8. [self addSubview:webView];   9. [webView release];
?

热点排行