一,效果图。

二,工程图。

三,代码。

RootViewController.h

#import <UIKit/UIKit.h>

@interface RootViewController : UIViewController

@end

RootViewController.m

#import "RootViewController.h"
#import "FirstViewController.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.view.backgroundColor=[UIColor redColor];
self.title=@"root"; }
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
//点击root,也就是红色的任何处,页面会像翻书一样翻转。翻转到first,也就是蓝色的界面。当点击顶部root页面部分的时候,页面会重新翻到root,也就是红色的界面。 FirstViewController *firstView=[[FirstViewController alloc]init];
UINavigationController *nav=[[UINavigationController alloc] initWithRootViewController:firstView];
nav.modalTransitionStyle=UIModalTransitionStylePartialCurl;
[self.navigationController presentViewController:nav animated:YES completion:nil];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

FirstViewController.h

#import <UIKit/UIKit.h>

@interface FirstViewController : UIViewController

@end

FirstViewController.m

#import "FirstViewController.h"

@interface FirstViewController ()

@end

@implementation FirstViewController

- (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.view.backgroundColor=[UIColor blueColor];
self.title=@"first";
} - (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
 
 

【代码笔记】iOS-翻页效果的实现的更多相关文章

  1. iOS:翻页效果

    // // main.m // Hello // // Created by lishujun on 14-8-28. // Copyright (c) 2014年 lishujun. All rig ...

  2. iOS:横向使用iPhone默认的翻页效果

    大致思路使用两层辅助UIView的旋转来实现添加后的View的横向翻页效果 CATransform3D transformA = CATransform3DRotate(CATransform3DId ...

  3. 关于Page翻页效果, PageViewConrtoller

    Page View Controllers你使用一个page view controller用page by page的方式来展示内容.一个page view controller管理一个self-c ...

  4. webapp应用--模拟电子书翻页效果

    前言: 现在移动互联网发展火热,手机上网的用户越来越多,甚至大有超过pc访问的趋势.所以,用web程序做出仿原生效果的移动应用,也变得越来越流行了.这种程序也就是我们常说的单页应用程序,它也有一个英文 ...

  5. css实现翻页效果

    如图,鼠标移动到图上,实现右上角翻页的效果,本例主要border边框的设置. 一.基本概念 <html> <head> <style> #demo{ width:0 ...

  6. ajax翻页效果模仿yii框架

    ajax翻页效果,模仿yii框架. 复制代码代码如下: <!DOCTYPE html>  <html>  <head>  <title>ajax分页_w ...

  7. Android 实现书籍翻页效果----完结篇

    By 何明桂(http://blog.csdn.net/hmg25) 转载请注明出处 之前由于种种琐事,暂停了这个翻页效果的实现,终于在这周末完成了大部分功能,但是这里只是给出了一个基本的雏形,没有添 ...

  8. Android 滑动效果高级篇(七)—— 华丽翻页效果

    By 何明桂(http://blog.csdn.net/hmg25) 转载请注明出处 之前看到像ipad上的ibook的模拟书籍翻页的特效感觉很炫,在android上也有像laputa和ireader ...

  9. transform3D实现翻页效果

    ---恢复内容开始--- 闲篇 最近升级了下百度音乐,唯一的感觉就是动画效果很炫丽.我不是个对产品很敏感的人,但是这段时间观察一些大厂的产品发现现在的APP越来越重视动画效果了.大家可能没有注意过,连 ...

随机推荐

  1. 【转】NoSQL初探之人人都爱Redis:(1)Redis简介与简单安装

    一.NoSQL的风生水起 1.1 后Web2.0时代的发展要求 随着互联网Web2.0网站的兴起,传统的关系数据库在应付Web2.0网站,特别是超大规模和高并发的SNS类型的Web2.0纯动态网站已经 ...

  2. 在_Layout模版中使用@Styles.Render()没有效果

    刚才有测试一个功能,就是在_Layout母版中使用了@Styles.Render()时行Render样式文件,所有在此母版下的视图均没有应用到样式,没有效果.是什么原因? 经查证资料,原来Insus. ...

  3. 关于MySql中的varchar类型

    今天新开始的项目在做数据库设计,发现自己对MySql的varchar类型还不熟悉,故又上网收集资料整理如下. 1.varchar类型的变化 MySQL 数据库的varchar类型在4.1以下的版本中的 ...

  4. MySQL Information Functions

    Table 12.18 Information Functions Name Description BENCHMARK() Repeatedly execute an expression CHAR ...

  5. Eclipse常用的快捷键

    Eclipse常用快捷键 1,       Ctrl+S,保存文档. 2,       Tab,多行同时右移:选中多行 3,       shlft+tab,多行同时左移,选中多行 4,       ...

  6. java入门必备单词

    ① anchor 锚 锚点 ② administrator 管理员 ③ application 应用程序 ④ align 对齐 ⑤ attribute 属性 ⑥ access 访问 ⑦ break 暂 ...

  7. 容器--LinkedList

    一.前言 上一篇我们介绍了List的重要实现之一ArrayList,  在大多数情况下,我们写代码时会直接使用到ArrayList,因为其在随机访问的优势是其它List无法比拟的.除了ArrayLis ...

  8. C++静态库和动态库的区别

    转自http://www.cnblogs.com/skynet/p/3372855.html 什么是库? 库是写好的现有的,成熟的,可以复用的代码.现实中每个程序都要依赖很多基础的底层库,不可能每个人 ...

  9. Web Serveice服务代理类生成及编译

    本文链接地址:http://www.cnblogs.com/dengxinglin/p/3334158.html 一.生成代理类 对于web service服务和wcf的webservice服务,我们 ...

  10. Release编译模式下,事件是否会引起内存泄漏问题初步研究

    题记:不常发生的事件内存泄漏现象 想必有些朋友也常常使用事件,但是很少解除事件挂钩,程序也没有听说过内存泄漏之类的问题.幸运的是,在某些情况下,的确不会出问题,很多年前做的项目就跑得好好的,包括我也是 ...