[iPhone] UIView FAQ
来源:互联网 发布:全国打击网络电信诈骗 编辑:程序博客网 时间:2024/05/29 02:47
1, Transform
Just write following codes to scale (also called zoom in/out, or transform) your view:
float scaleX = xxx, scaleY = xxx;
CGAffineTransform transform = CGAffineTransformMakeScale(scaleX, scaleY];
yourView.transform = transform;
After scaled, you can set scaleX, and scaleY to scale to original size.
2, Animation
- (void) transformYourView()
{
float scaleX = xxx, scaleY = xxx;
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.15]; //The default value is 0.2
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(animationFinshed:finsihed:context:)];
CGAffineTransform transform = CGAffineTransformMakeScale(scaleX, scaleY];
yourView.transform = transform;
[UIView commitAnimations];
}
- (void) animationFinshed:(NSString *) animationID finished:(NSNumber *)finished context:(void *)context
{
//To here, animation is finshed
}
3, Handle touch tap event;
You must customize UIView, and handle event.
//UICView.h
@interface UICView : UIView
@end
//UICView.m
@implementation UICView
//Handle touches began event
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
printf("members count=%i/r/n", touches.count);
for (UITouch *touch in touches)
{
printf("tap count = %i/r/n", touch.tapCount); //for dragging event, touch.tapCount is 0
}
[self touchesBegin:touches withEvent:event]; //You must invoke thisinterface, otherwise, application may can't handle event correctly.
}
@end
Just write following codes to scale (also called zoom in/out, or transform) your view:
float scaleX = xxx, scaleY = xxx;
CGAffineTransform transform = CGAffineTransformMakeScale(scaleX, scaleY];
yourView.transform = transform;
After scaled, you can set scaleX, and scaleY to scale to original size.
2, Animation
- (void) transformYourView()
{
float scaleX = xxx, scaleY = xxx;
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.15]; //The default value is 0.2
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(animationFinshed:finsihed:context:)];
CGAffineTransform transform = CGAffineTransformMakeScale(scaleX, scaleY];
yourView.transform = transform;
[UIView commitAnimations];
}
- (void) animationFinshed:(NSString *) animationID finished:(NSNumber *)finished context:(void *)context
{
//To here, animation is finshed
}
3, Handle touch tap event;
You must customize UIView, and handle event.
//UICView.h
@interface UICView : UIView
@end
//UICView.m
@implementation UICView
//Handle touches began event
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
printf("members count=%i/r/n", touches.count);
for (UITouch *touch in touches)
{
printf("tap count = %i/r/n", touch.tapCount); //for dragging event, touch.tapCount is 0
}
[self touchesBegin:touches withEvent:event]; //You must invoke thisinterface, otherwise, application may can't handle event correctly.
}
@end
- [iPhone] UIView FAQ
- iPhone UIView
- cocos2d-iphone FAQ
- iPhone-UIView 讲解
- Iphone中的UIView开发
- iPhone UIView 详解
- iphone UIView 详解
- UIView - iPhone Development Wiki
- Unity iPhone常见问题解答(FAQ)
- [IPhone] UIView与内存管理
- IPhone之UIView中动画
- IPhone之UIView中动画
- iphone--UIView翻转效果实现
- iphone学习笔记 – UIView
- IPhone之UIView中动画
- iPhone/iOS UIView开发总结
- iPhone 的 UIView的学习
- Iphone中的UIView开发 (转)
- PB5.0快速编译WINCE
- vc使用技巧集(二)
- Weblogic 数据源及连接池配置问题Warning! Connectivity to backend database not verified
- 4.10--如何在对话框中增加确认规则?
- CoolSky 天文迷不可错过的天文学软件 汉化补丁
- [iPhone] UIView FAQ
- windows 下 用 wubi 安 装 ubuntu
- 加入收藏代码
- 企业可用性的成熟:1-4阶段 Corporate Usability Maturity: Stages 1-4
- 设为首页代码
- java线程
- JAVA方法调用效率差别
- 我从零开始学黑莓开发的过程
- 开始学习 firstAppView.cpp