【代码笔记】iOS-翻书效果的实现
代码:
RootViewController.m

#import "RootViewController.h" @interface RootViewController () @end @implementation RootViewController - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
} - (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view. //初始化背景图
[self initBackgroundView];
}
#pragma -mark -functions
-(void)initBackgroundView
{
self.title=@"翻书效果的实现";
self.view.backgroundColor=[UIColor redColor]; //upButton
UIButton *upButton = [UIButton buttonWithType:UIButtonTypeCustom];
upButton.frame = CGRectMake(20, 420, 50, 26);
upButton.backgroundColor=[UIColor blueColor];
[upButton setTitle:@"up" forState:UIControlStateNormal];
[upButton addTarget:self action:@selector(doClickUpButton) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:upButton]; //downButton
UIButton *downButton = [UIButton buttonWithType:UIButtonTypeCustom];
downButton.frame = CGRectMake(250, 420, 50, 26);
downButton.backgroundColor=[UIColor blueColor];
[downButton setTitle:@"down" forState:UIControlStateNormal];
[downButton addTarget:self action:@selector(doClickDownButton) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:downButton]; }
#pragma -mark -doClickAction
-(void)doClickUpButton
{
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.7];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.view cache:YES];
[UIView commitAnimations];
}
-(void)doClickDownButton
{
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.7];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:YES];
[UIView commitAnimations];
} - (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
} @end

【代码笔记】iOS-翻书效果的实现的更多相关文章
- [知了堂学习笔记]_css3特效第一篇--旋转的背景&翻书效果
一.html遮盖层与css3的旋转动画 >效果图(加载可能会慢一点儿,请稍等...): >实现思路:在一个大的div中装入一个底层img和顶层的div(里面的内容按照以上图片呈现的样式布局 ...
- JS实现图片翻书效果示例代码
js 图片翻书效果. picture.html <html xmlns="http://www.w3.org/1999/xhtml"> <head> ...
- Turn.js 实现翻书效果的学习与总结
最近CTO给我分配了一个移动端H5开发的任务,主要功能是需要实现翻书效果,我听过主要需求后,当时是呀!!!接下来自己尝试使用fullPage.js和Swiper来实现翻书效果,结果效果都不是非常的理想 ...
- turn.js实现翻书效果
JS插件网 http://www.ijquery.cn/?p=173 描述:Turn.js 是一个轻量级的 (15kb) jQuery/html5 插件用来创建类似书本和杂志翻页效果,支持触摸屏设备. ...
- 基于CSS3新属性Animation及transform实现类似翻书效果
注:本实例JS部分均以原生JS编写,不善用原生JS的,可用jQuery等对三方框架改写 先上效果图:(样式有点丑,可以忽略一下下,效果出来了就好,后期加到其他项目中方便更改0.0) 类似翻书效果,原本 ...
- UIScrollView翻书效果
代码地址如下:http://www.demodashi.com/demo/12695.html 前言:看到凤凰新闻 头条栏目的编辑推荐新闻是这个效果,觉得不错,就想着实现一下,以下就是我的实现过程. ...
- css3特效第一篇--旋转的背景&翻书效果
一.html遮盖层与css3的旋转动画 >效果图(加载可能会慢一点儿,请稍等...): >实现思路:在一个大的div中装入一个底层img和顶层的div(里面的内容按照以上图片呈现的样式布局 ...
- 15 个最佳 jQuery 翻书效果插件
本文为你带来15个非常实用的.实现类似翻书效果的jQuery插件,你可以很容易地整合到你的web应用中,提升用户体验. 1. BookBlock BookBlock可以将任何内容(如图像.文本)创建 ...
- Unity3d:megaFierstext(翻书效果插件)
附件中是一款翻书效果插件,由于附件上传大小限制,在下载完后,需要在megaFierstext_BHYF\Assets\Resources\Textures下添加图片精灵并修改属性为Texture,即可 ...
随机推荐
- Jmeter操作手册
以前没有发pdf的版本,我现在把pdf版本放在百度网盘里面了,需要的童鞋可以去下载:http://pan.baidu.com/s/1bp43jeJ Ksudi Jmeter操作指南 简要说明 Beck ...
- JS实现简易的计算器
JS可以做的事多了,那就用来实现一个计算器吧 看看手机中的计算器,分为普通计算器和科学计算器 自认脑袋不够大,就实现一个普通版本的吧(支持正负数加减乘除等基本连续的运算,未提供括号功能) 看看 ...
- 模拟checkbox的最优最简方法
<label> <input type="/> <span class="iconfont"></span> </l ...
- Android去掉listView,gridView等系统自带阴影
当我们使用listView的时候,拉到顶,或是拉到底部的时候,我们会发现有系统自带的阴影效果出现,不同手机出现的颜色可能还会不一样. 在以前我始终都有注意到此问题,一直以为是系统自带的,不能去掉.也没 ...
- EntityFramework6.0的Sql读写分离拦截器 和 MVC的 Action拦截器 对比
EF的DbCommandInterceptor类 拦截: EF6.1也出来不少日子了,6.1相比6.0有个很大的特点就是新增了System.Data.Entity.Infrastructure.Int ...
- EXCEL countif函数多条件
在MS EXCEL中,countif如果要满足多个条件怎么办呢? 1.答案就是:使用条件集合{}和sum函数. 即在countif()第二个参数中使用条件集合{},然后用sum()函数求满足这些条件的 ...
- iOS阶段学习第30天笔记( UIViewController—Delegate(代理) )
iOS学习(UI)知识点整理 一.UIViewController的介绍 1)概念:UIViewController 即视图控制器,用来管理和控制页面跳转的一个类 ,iOS里面采用了MVC的体系结构, ...
- MFC 阶段学习总结
由于项目需求,需要用到C++开发软件,所以开始学习C++,重点是MFC,因为是窗体应用,感觉win32的比较麻烦,还是MFC方便点.至于为什么要用C++呢, 由于C++应用不需要客户额外安装环境和加密 ...
- 2016 大连网赛---Weak Pair(dfs+树状数组)
题目链接 http://acm.split.hdu.edu.cn/showproblem.php?pid=5877 Problem Description You are given a rooted ...
- 2016暑假多校联合---Another Meaning
2016暑假多校联合---Another Meaning Problem Description As is known to all, in many cases, a word has two m ...