animateWithDuration
来源:互联网 发布:巨人名录数据库网站 编辑:程序博客网 时间:2024/05/01 14:02
1.frame, bounds ,center 三者之间的关系
搞iOS开发的童鞋基本都会用过UIView,那他的bounds和frame两个属性也不会陌生,那这两个有什么实质性的区别呢?
先看到下面的代码你肯定就明白了一些:
}
-(CGRect)bounds{
}
很明显,bounds的原点是(0,0)点,而frame的原点却是任意的。
+ (void)animateWithDuration:(NSTimeInterval
)duration
animations:(void (^ _Nonnull)(void)
)animations
completion:(void (^ _Nullable)(BOOL finished)
)completion
duration 是动画的时间,而动画效果的最终位置是在animations 里面设置的。
3.CGPointMake ,CGRectMake
CGPoint: 表示一个二维坐标系中的点
CGSize: 表示一个矩形的宽度和高度
CGRect: 表示一个矩形的位置和大小
4.代码分析CGPoint: 表示一个二维坐标系中的点
- (void)show
{
[super show];//这个show 是否需要防止在后面呢?因为[super show]将contentview 已经加载到UIViews 上面去了。
CGRect frame = self.contentView.frame;
self.contentView.frame =CGRectMake(0, [UIScreenmainScreen].bounds.size.height, frame.size.width, frame.size.height);
[UIViewanimateWithDuration:0.3
animations:^{
self.contentView.frame = frame;
} completion:^(BOOL finished) {
}];
}
- (void)dismiss
{ [UIViewanimateWithDuration:0.3
animations:^{
self.contentView.frame =CGRectMake(0, [UIScreenmainScreen].bounds.size.height,self.contentView.frame.size.width,self.contentView.frame.size.height);
} completion:^(BOOL finished) {
[super dismiss];
}];
}
- animateWithDuration
- UIView animateWithDuration
- UIView animateWithDuration
- UIView animateWithDuration 使用详解
- UIView animateWithDuration 使用详解
- animateWithDuration使用详解
- UIView animateWithDuration 使用详解
- UIView animateWithDuration 使用详解
- UIView animateWithDuration 使用详解
- UIView animateWithDuration 使用详解
- UIView animateWithDuration 使用详解
- UIView animateWithDuration 使用详解
- UIView animateWithDuration 使用详解
- UIView animateWithDuration 使用详解
- UIView animateWithDuration 使用详解
- UIView animateWithDuration:animation:completion
- animateWithDuration动画效果
- ios UIView animateWithDuration 学习
- android 设置全屏与非全屏
- LeetCode Missing Number 数组
- Codeforces Round #331 (Div. 2) B. Wilbur and Array
- shell&&linux 常用命令
- 爬虫入门讲解:基础理论篇
- animateWithDuration
- 切忌在类的初始化列表中调用类的成员函数
- String、StringBuffer与StringBuilder之间区别
- 选择器实现排序方法
- mysql密码修改
- rwerwqerwqerwer
- 第一篇:如何生成每秒百万级别的 HTTP 请求?
- CenTos OpenVpn 一键安装包
- C++基础::非类型模板参数在STL中的应用