Tuesday, December 17, 2013

Cover flow (iPad) code-sharing

 
- (Void) viewDidLoad {
[(AFOpenFlowView *) self.view setNumberOfImages: 40];
for (int i = 0; i <= 40; i + +) {
UIImage * image = [UIImage imageNamed: [NSString stringWithFormat: @ "t% d.jpg", i% 6]];
[(AFOpenFlowView *) self.view setImage: image forIndex: i];
}
[Super viewDidLoad];
}



/ / Override to allow orientations other than the default portrait orientation.
- (BOOL) shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation) interfaceOrientation {
return YES;
}

- (Void) didReceiveMemoryWarning {
/ / Releases the view if it doesn't have a superview.
[Super didReceiveMemoryWarning];

/ / Release any cached data, images, etc that aren't in use.
}

- (Void) viewDidUnload {
/ / Release any retained subviews of the main view.
/ / E.g. self.myOutlet = nil;
}


- (Void) dealloc {
[Super dealloc];
}

@ End

/ /
/ / CoverFlowTestAppDelegate.m
/ / CoverFlowTest
/ /
/ / Created by tt on 10-8-15.
/ / Copyright TT 2010. All rights reserved.
/ /

# Import "CoverFlowTestAppDelegate.h"
# Import "CoverFlowTestViewController.h"

@ Implementation CoverFlowTestAppDelegate

@ Synthesize window;
@ Synthesize viewController;


# Pragma mark -
# Pragma mark Application lifecycle

- (BOOL) application: (UIApplication *) application didFinishLaunchingWithOptions: (NSDictionary *) launchOptions {

/ / Override point for customization after app launch.
[Window addSubview: viewController.view];
[Window makeKeyAndVisible];

return YES;
}


- (Void) applicationWillResignActive: (UIApplication *) application {
/ *
Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state .
Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
* /
}


- (Void) applicationDidBecomeActive: (UIApplication *) application {
/ *
Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
* /
}


- (Void) applicationWillTerminate: (UIApplication *) application {
/ *
Called when the application is about to terminate.
See also applicationDidEnterBackground:.
* /
}


# Pragma mark -
# Pragma mark Memory management

- (Void) applicationDidReceiveMemoryWarning: (UIApplication *) application {
/ *
Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later.
* /
}


- (Void) dealloc {
[ViewController release];
[Window release];
[Super dealloc];
}


@ End






The complete code can be downloaded to my blog, no gold.

In addition, some iPhone developers classics for you to download.

http://topic.csdn.net/u/20110527/11/5bbea603-b2a1-4fc2-9609-cf4e6882b38a.html?28749
Reply:
Top landlord, the way a white problem, brackets ipad, iphone so you can use it?
Reply:
Ask the landlord, the cover flow can only be used to display UIImage do. If I want to show how to deal with dynamic content?
Reply:
cited a floor yukiwang313 reply:
top landlord, the way a white problem, brackets ipad, iphone so you can use it?


Can
Reply:
cited a floor yukiwang313 reply:
top landlord, the way a white problem, brackets ipad, iphone so you can use it?


Currently only images, dynamic, then I finished writing a blog, it spread Demo.
Reply:
Landlord write code not written comments. . .
Reply:
references, 5th Floor a_spring reply:
landlord write the code does not write comments. . .


Top
Eager to comment!
Reply:
references, 4th Floor orietech reply:
cited a floor yukiwang313 reply:

Top landlord, the way a white problem, brackets ipad, iphone so you can use it?


Currently only images, dynamic, then I finished writing a blog, it spread Demo.

The landlord, seeking demo to learn loads dynamic content! Thank you!
Reply:
references, 4th Floor orietech reply:
cited a floor yukiwang313 reply:

Top landlord, the way a white problem, brackets ipad, iphone so you can use it?


Currently only images, dynamic, then I finished writing a blog, it spread Demo.

The landlord, in this dynamic demo blog not find ah?

No comments:

Post a Comment