iOS界面动画特效
1、TableView的headView背景图片拉伸

- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
_bgImage =[[UIImageView alloc] initWithFrame:CGRectMake(, , CScreenWidth, CScreenHeight)];
_bgImage.image = [UIImage imageNamed:@"pic4"];
orginYframe = _bgImage.frame;
[self.view addSubview:_bgImage];
_headView = [[UIView alloc] initWithFrame:CGRectMake(, , CScreenWidth, )];
_headView.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:];
_titleLBel = [[UILabel alloc] init];
_titleLBel.frame =CGRectMake(, , CScreenWidth, );
_titleLBel.text = @"测试界面";
_titleLBel.textColor = [UIColor greenColor];
_titleLBel.textAlignment = NSTextAlignmentCenter;
[_headView addSubview:_titleLBel];
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
[btn addTarget:self action:@selector(addDataClick) forControlEvents:UIControlEventTouchUpInside];
[btn setTitle:@"back" forState:UIControlStateNormal];
[btn setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
btn.frame = CGRectMake(, , , );
[_headView addSubview:btn];
[self.view addSubview:_headView];
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(, , CScreenWidth, CScreenHeight-)];
UIView *headViewT = [[UIView alloc] initWithFrame:CGRectMake(, , CScreenWidth, )];
headViewT.backgroundColor = [UIColor clearColor];
_tableView.tableHeaderView = headViewT;
_tableView.delegate =self;
_tableView.dataSource = self;
_tableView.backgroundColor = [UIColor clearColor];
[self.view addSubview:_tableView];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return ;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
cell.textLabel.text =@"测试一下";
return cell;
}
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
CGFloat offSetY = scrollView.contentOffset.y;
NSLog(@"===%f",offSetY);
if (offSetY < )
{
_titleLBel.textColor = [UIColor blueColor];
_headView.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:offSetY/];
}
else
{
_titleLBel.textColor = [UIColor redColor];
_headView.backgroundColor = [UIColor whiteColor];
}
if (offSetY > )
{
_bgImage.frame = ({
CGRect frame = _bgImage.frame;
frame.origin.y = orginYframe.origin.y - offSetY;
frame;
});
}
else
{
_bgImage.frame = ({
CGRect frame = _bgImage.frame;
frame.size.width =orginYframe.size.width -offSetY;
frame.size.height = orginYframe.size.height *frame.size.width/ orginYframe.size.width;
frame.origin.x = -(frame.size.width - orginYframe.size.width)/;
NSLog(@"----%@",NSStringFromCGRect(frame));
frame;
});
}
if (offSetY ==)
{
_titleLBel.textColor = [UIColor redColor];
}
}
iOS界面动画特效的更多相关文章
- Android的Activity切换动画特效库SwitchLayout,视图切换动画库,媲美IOS
由于看了IOS上面很多开发者开发的APP的视图界面切换动画体验非常好,这些都是IOS自带的,但是Android的Activity等视图切换动画并没有提供原生的,所以特此写了一个可以媲美IOS视图切换动 ...
- (NO.00004)iOS实现打砖块游戏(二):实现游戏主界面动画
大熊猫猪·侯佩原创或翻译作品.欢迎转载,转载请注明出处. 如果觉得写的不好请告诉我,如果觉得不错请多多支持点赞.谢谢! hopy ;) 一个内容不错的游戏也要一个好的包装.玩家进入游戏时第一眼看到的是 ...
- Bodymovin:Bodymovin和Lottie:把AE动画转换成HTML5/Android/iOS原生动画
转自:https://www.cnblogs.com/zamhown/p/6688369.html 大杀器Bodymovin和Lottie:把AE动画转换成HTML5/Android/iOS原生动画 ...
- 大杀器Bodymovin和Lottie:把AE动画转换成HTML5/Android/iOS原生动画
前段时间听部门老大说,Airbnb出了个移动端的动画库Lottie,可以和一个名叫Bodymovin的AE插件结合起来,把在AE上做好的动画导出为json文件,然后以Android/iOS原生动画的形 ...
- iOS界面开发
[转载] iOS界面开发 发布于:2014-07-29 11:49阅读数:13399 iOS 8 和 OS X 10.10 中一个被强调了多次的主题就是大一统,Apple 希望通过 Hand-off ...
- 仿Material UI框架的动画特效
Material UI是一款功能非常强大,界面却十分清新简洁的CSS框架,Material UI利用了Google的Material Design 全新设计语言,并且让每一个UI组件都变得非常独立,因 ...
- 【IOS界面布局】横竖屏切换和控件自适应(推荐)
[IOS界面布局]横竖屏切换和控件自适应(推荐) 分类: [MAC/IOS下开发]2013-11-06 15:14 8798人阅读 评论(0) 收藏 举报 横竖屏切换 自适应 第一种:通过人为的办法改 ...
- 超炫HTML5 SVG聊天框拖拽弹性摇摆动画特效
这是一款很有创意的HTML5 SVG聊天框拖拽弹性摇摆动画特效. 用户能够用鼠标点击或用手滑动聊天框上的指定区域,该区域会以很有弹性的弹簧效果拉开聊天用户列表.点击一个用户头像后.又以同样的弹性特效切 ...
- ios 学习动画的套路 (一)
你也肯定喜欢炫酷的动画! 在APP中,动画就是一个点睛之笔!可以给用户增加一些独特的体验感,估计也有许多的和我一样的,看着那些觉得不错的动画,也就只能流口水的孩子,毕竟~不知道从哪里下手去写!会连续的 ...
随机推荐
- shell 一些命令(转)
shell 一些命令(转) https://www.cnblogs.com/amei0/p/8041989.html 参考文档 http://man.linuxde.net/ 一.awk 求和 awk ...
- opencv——基础篇
一 . opencv是什么及其作用? OpenCV是一个基于BSD许可(开源)发行的跨平台计算机视觉库,可以运行在Linux.Windows.Android和Mac OS操作系统上.它轻量级而且高效— ...
- Neo4j 3.5发布,在索引方面大幅增强
Neo4j 3.5版本已正式发布,这也是Neo4j宣布企业版闭源以来发布的第一个版本. 这个版本在性能.资源使用率以及安全方面均有增强,我们可以先快速浏览一下这个版本: 全文索引 基于Index的快速 ...
- java 冒泡排序法、选择排序
1.冒泡排序 /* * 冒泡排序 * 外层控制循环多少趟,内层控制每一趟的循环次数 */ public class Test08 { public static void main(String[] ...
- Hive中SQL查询转换成MapReduce作业的过程
- 测试用例覆盖率converage
当报如下错误: TypeError: 'ModuleImportFailure' object is not iterable 或者 TypeError: '_FailedTest' object i ...
- android studio toolbar遮挡住下面控件内容
只需要在该控件布局(content_***.xml)加入: app:layout_behavior="@string/appbar_scrolling_view_behavior" ...
- CodeForces - 803F
http://codeforces.com/problemset/problem/803/F #include <iostream> #include <cstdio> #in ...
- [JZOJ3347] 【NOI2013模拟】树的难题
题目 题目大意 给你一棵树,每个节点有三种黑.白.灰三种颜色. 你要割掉一些边(每条边被割需要付出一定的代价),使得森林的每棵树满足: 没有黑点或至多一个白点. 思考历程 这题一看就知道是一个树形DP ...
- QT安装以及使用(QT支持linux和windows,也支持C/C++代码的编译运行,比vs简洁多)
Windows: 0. QT Versionqt-win-opensource-4.7.4-mingwqt-creator-win-opensource-2.4.1 1. 系统Windows 7 &a ...