1
我正在尝试使用Google API在我的应用程序中放置一些图形,但它并不工作。我在互联网上测试了其他图像的代码,它工作。iPhone开发 - 来自Google API的图表
代码:
- (void)viewDidLoad {
[super viewDidLoad];
UIImage *myimage = [UIImage imageWithData: [NSData dataWithContentsOfURL: [NSURL URLWithString: @"http://chart.apis.google.com/chart?cht=bvo&chd=t:10,50,60,80,40&chl=Hello|World|hi&chs=250x100"]]];
UIImageView *test = [[UIImageView alloc] initWithImage:myimage];
UIView *myView = [[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, 100.0, 100.0)];
[myView addSubview:test];
[self.view addSubview:myView];
}
感谢, 克劳迪奥
非常好!非常感谢! – Claudio 2010-08-06 05:59:04