我需要显示2条线图在我的应用程序,我不想使用核心情节一样是矫枉过正,只显示2变种的高度吧,[UIImageView的与box.png]IOS简单的条形图动画
我已经做了一些测试,只是使用UIView动画,这似乎足以使酒吧成长或缩小,[问题是高度取决于起点,所以我的酒吧没有0点为Y,至极随着酒吧的高度变化]
所以我怎么能为我的Y轴设置点0,所以我只需要考虑高度,而不是起点呢?
或应我去一些酒吧发电机框架,也不是那么超必杀为core-plot ,,
什么是最简单的,重量最轻?
ecgraph,其他?
PS。另外一点是,我需要有图表自定义背景以及自定义栏这就是为什么即时通讯使用的box.png了吧]
代码...
viewDidLoad { ***
CGRect chartbackGroundImageRect = CGRectMake(150, 20, 632, 653);
UIImageView *chartbackGroundImage = [[UIImageView alloc] initWithFrame:chartbackGroundImageRect];
[chartbackGroundImage setImage:[UIImage imageNamed:@"chartArtBgnd.png"]];
chartbackGroundImage.opaque = YES; // explicitly opaque for performance
[self.view addSubview:chartbackGroundImage];
[chartbackGroundImage release];
CGRect leftBarImageRect = CGRectMake(550, 550, 81, 40);
leftBarImage = [[UIImageView alloc] initWithFrame:leftBarImageRect];
[leftBarImage setImage:[UIImage imageNamed:@"leftBar.png"]];
leftBarImage.opaque = YES; // explicitly opaque for performance
[self.view addSubview:leftBarImage];
[leftBarImage release];
***}
testBarAnimation {***
// Setup the animation
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.2]; //animation for arrow
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
[UIView setAnimationBeginsFromCurrentState:YES];
CGRect newFrame = CGRectMake(550, 300, 81, 290);
leftBarImage.frame = newFrame;
[UIView commitAnimations];
***}
非常感谢!
显示你的代码,它是理解代码比解释更容易。 – ikuramedia
@ikuragames嗨,请检查编辑的问题上的代码谢谢! – MaKo
@MaKo:为什么不创建一个简单的'UIView'子类,为您的图形绘制可变形状的块?您可以使用Core Animation动画化内容。 –