iOS 3D效果的界面选择Demo

项目的首页界面要一个3D效果的,这个做个Demo,大家可以参考下。这个例子呢?是我从网上找个,不过不知道,之前写Demo的人,多么的神奇,很简单就能搞定的东西,那人弄的好神奇,我看了足足1个小时。这里传一个容易看懂的,至少我觉得好懂。

代码下载:http://download.csdn.net/detail/qqmcy/7035009

框架类例子中有。

ViewController.h

#import <UIKit/UIKit.h>
#import "FlowCoverView.h"

@interface ViewController : UIViewController<FlowCoverViewDelegate>

@property (strong , nonatomic) FlowCoverView* m_FlowCoverView;

@end

ViewController.m

//获取屏幕高度
#define ScreenHeight [[UIScreen mainScreen] bounds].size.height
//获取屏幕宽度
#define ScreenWidth [[UIScreen mainScreen] bounds].size.width


#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    
    self.m_FlowCoverView = [[FlowCoverView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight)];
    self.m_FlowCoverView.delegate = self;
    [self.view addSubview:self.m_FlowCoverView];
}

- (int)flowCoverNumberImages:(FlowCoverView *)view
{
	return 6;
}

- (UIImage *)flowCover:(FlowCoverView *)view cover:(int)image
{
	switch (image % 6) {
		case 0:
		default:
			return [UIImage imageNamed:@"changmen.jpg"];
		case 1:
			return [UIImage imageNamed:@"changmen.jpg"];
		case 2:
			return [UIImage imageNamed:@"changmen.jpg"];
		case 3:
			return [UIImage imageNamed:@"changmen.jpg"];
		case 4:
			return [UIImage imageNamed:@"changmen.jpg"];
		case 5:
			return [UIImage imageNamed:@"changmen.jpg"];
	}
}

- (void)flowCover:(FlowCoverView *)view didSelect:(int)image
{
	NSLog(@"Selected Index %d",image);
}





iOS 3D效果的界面选择Demo,,5-wow.com

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。