UITableViewCell和UICollectionView的几种动画
2015-09-15 22:09
316 查看
tableView 的动画
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
cell.frame = CGRectMake(self.view.frame.size.width * 2, cell.frame.origin.y, cell.frame.size.width, cell.frame.size.height);
[UIView animateWithDuration:0.5 animations:^{
cell.frame = CGRectMake(0, cell.frame.origin.y, cell.frame.size.width, cell.frame.size.height);
} completion:^(BOOL finished) {
;
}];
}
collectionView的动画
- (void)collectionView:(UICollectionView *)collectionView willDisplayCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath
{
CGRect newFrame = cell.frame;
cell.frame = CGRectMake(0, 0, cell.frame.size.width, cell.frame.size.height);
[UIView animateWithDuration:0.5 animations:^{
cell.frame = newFrame;
} completion:^(BOOL finished) {
;
}];
}
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
cell.frame = CGRectMake(self.view.frame.size.width * 2, cell.frame.origin.y, cell.frame.size.width, cell.frame.size.height);
[UIView animateWithDuration:0.5 animations:^{
cell.frame = CGRectMake(0, cell.frame.origin.y, cell.frame.size.width, cell.frame.size.height);
} completion:^(BOOL finished) {
;
}];
}
collectionView的动画
- (void)collectionView:(UICollectionView *)collectionView willDisplayCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath
{
CGRect newFrame = cell.frame;
cell.frame = CGRectMake(0, 0, cell.frame.size.width, cell.frame.size.height);
[UIView animateWithDuration:0.5 animations:^{
cell.frame = newFrame;
} completion:^(BOOL finished) {
;
}];
}
相关文章推荐
- 对UIView的总结
- NEVER QUIT. NEVER SAY NEVER.
- Servlet之request请求、ServletContext、ServletConfig
- 自绘菜单的实现 ----------原作者querw
- UITextView内容添加后,自动滚动到最后一行
- soapui 自动化教程(四)
- UITableViewCell 消除右侧辅助视图区域空白
- UIPickerView
- uva 12167 Proving Equivalences(强连通分量 + 缩点)
- iOS中的UITabBarController(标签视图控制器)
- UI03_UITextField
- iOS:删除storyBoard,纯代码实现UITabBarController的视图切换功能
- ArrayBlockingQueue学习笔记
- NSDate将日期类字符串Tue Sep 15 19:00:03 +0800 2015转化为09-15 19:52日期类型的格式
- 【Java GUI】Java面板基础:JPanel
- UIBUTTON.NORMALSPRITE
- Qt 学习之路 :Qt Quick Controls
- DFGUI-- 标签交换 Tabstrip
- UIImagePickerController的静态方法
- HDOJ 1005 Number Sequence