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中,动画就是一个点睛之笔!可以给用户增加一些独特的体验感,估计也有许多的和我一样的,看着那些觉得不错的动画,也就只能流口水的孩子,毕竟~不知道从哪里下手去写!会连续的 ...
随机推荐
- python学习5—一些关于基本数据结构的练习题
python学习5—一些关于基本数据结构的练习题 # 1. use _ to connect entries in a list # if there are no numbers in list l ...
- ARM多核处理器启动过程分析
版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/qianlong4526888/article/details/27695173 说明: 该流程图依照 ...
- Vue键盘事件
键盘事件一 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <tit ...
- PHP算法之Z 字形变换
将一个给定字符串根据给定的行数,以从上往下.从左到右进行 Z 字形排列. 比如输入字符串为 "LEETCODEISHIRING" 行数为 3 时,排列如下: L C I RE T ...
- openwrt MySQL移植
1 选择包 选择两个包,拷贝配置文件 cp products/mt7621/config_6080 .config 编译固件 openwrt 百万数据的优化, 执行脚本: mysql -u root ...
- Centos 6.5 python版本升级到2.7.8
Centos6.5默认的 python版本是2.6 为了使用aliyuncli工具,直接用pip安装aliyuncli提示错误. 所以决定升级下python版本,但是yum依赖于python2.6,升 ...
- 20170702-变量说明,静态方法,类方法区别,断点调试,fork,yield协程,进程,动态添加属性等。。
概念: 并行:同时运行 并发:看似同时运行 json后任然中文的问题 import json d = {"名字":"初恋这件小事"} new_d1 = jso ...
- thinkphp 应用编译
应用编译机制作为ThinkPHP独创的功能特色,从1.0版本就延续至今,3.2版本的编译机制更加具有特色. 应用编译缓存 编译缓存的基础原理是第一次运行的时候把核心需要加载的文件去掉空白和注释后合并到 ...
- mysql mac客户端: sequel,mysql-workbench
sequel: https://sequelpro.com/download#auto-start mysql-workbench:https://dev.mysql.com/downloads/fi ...
- VS2010-MFC(常用控件:标签控件Tab Control 下)
转自:http://www.jizhuomi.com/software/207.html 上一节讲了标签控件知识的上半部分,本节继续讲下半部分. 标签控件的创建 MFC为标签控件的操作提供了CTabC ...