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中,动画就是一个点睛之笔!可以给用户增加一些独特的体验感,估计也有许多的和我一样的,看着那些觉得不错的动画,也就只能流口水的孩子,毕竟~不知道从哪里下手去写!会连续的 ...
随机推荐
- Git的故事
目录 Git Git的概念 Git的安装 Git的配置 Git的指令 Git Git的概念 首先我们要知道git是什么,最根本的概念是版本控制,顾名思义,就是git可以帮助我们控制自己写的代码或者文档 ...
- hashmap1.7的死锁模拟
package com.cxy.springdataredis.hashmap; import javax.lang.model.element.VariableElement; import jav ...
- vue sChart组件使用页面一片空白问题及示例
参考:https://www.ctolib.com/mip/lin-xin-vue-schart.html 在网上其他示例里,我试验后发现:渲染到<canvas id="myChart ...
- Theorem、Proposition、Lemma和Corollary等的解释与区别
Theorem:定理.是文章中重要的数学化的论述,一般有严格的数学证明. Proposition:可以翻译为命题,经过证明且interesting,但没有Theorem重要,比较常用. Lemma:一 ...
- .net 接受请求过来的流
//接收POST过来的数据 System.IO.Stream s = Request.InputStream; int count = 0; byte[] buffer = new byte[1024 ...
- RAKsmart服务器受消费者青睐的原因
随着互联网的快速发展,网站建设变得越来越重要,现在很多做外贸网站的都会选择美国服务器来建设网站,近年来RAKsmart服务器受到广大站长的欢迎,那RAKsmart服务器受消费者青睐的关键是什么呢. 1 ...
- ctrl+shift+k取消
因为typora软件和搜狗输入法软件的快捷键重合了,ctrl+shift+k在typora中是代码块的快捷键,而在搜狗输入法中是软键盘快捷键,显然软键盘不重要. 搜狗输入法的ctrl+shift+k取 ...
- Json数据交换一Jackson
依赖 <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>ja ...
- thinkphp DEFINED标签
DEFINED标签用于判断某个常量是否有定义,用法如下: 大理石平台检验标准 <defined name="NAME"> NAME常量已经定义 </defined ...
- hibernate_03_hibernate一对多的关系映射
1.实体类的一对多的关系映射 一个客户对应多个联系人 Customer.java public class Customer { private Long cust_id; private Strin ...