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