FlowCover 问题目标 C
我正在尝试使用 FlowCover -> http://www.chaosinmotion.com/flowcover.m 但它不起作用。
这是我的接口类:
#import <UIKit/UIKit.h>
#import "FlowCoverView.h"
@interface TesterCoverFlowViewController : UIViewController <FlowCoverViewDelegate> {
}
- (IBAction)done:(id)sender;
@end
这是我的实现类:
#import "TesterCoverFlowViewController.h"
@implementation TesterCoverFlowViewController
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) ||
(interfaceOrientation == UIInterfaceOrientationLandscapeRight));
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
}
- (void)dealloc
{
[super dealloc];
}
- (IBAction)done:(id)sender
{
[[self parentViewController] dismissModalViewControllerAnimated:YES];
}
/************************************************************************/
/* */
/* FlowCover Callbacks */
/* */
/************************************************************************/
- (int)flowCoverNumberImages:(FlowCoverView *)view
{
return 64;
}
- (UIImage *)flowCover:(FlowCoverView *)view cover:(int)image
{
switch (image % 6) {
case 0:
default:
return [UIImage imageNamed:@"a.png"];
case 1:
return [UIImage imageNamed:@"b.png"];
case 2:
return [UIImage imageNamed:@"c.png"];
case 3:
return [UIImage imageNamed:@"x.png"];
case 4:
return [UIImage imageNamed:@"y.png"];
case 5:
return [UIImage imageNamed:@"z.png"];
}
}
- (void)flowCover:(FlowCoverView *)view didSelect:(int)image
{
NSLog(@"Selected Index %d",image);
}
@end
大部分代码取自网站。
我需要对界面做任何事情吗?因为什么也没有出现!没有错误,我只是没有看到任何 coverflow (或 flowcover)。
谢谢
I'm trying to make use of FlowCover -> http://www.chaosinmotion.com/flowcover.m but it is not working.
This is my interface class:
#import <UIKit/UIKit.h>
#import "FlowCoverView.h"
@interface TesterCoverFlowViewController : UIViewController <FlowCoverViewDelegate> {
}
- (IBAction)done:(id)sender;
@end
This is my implementation class:
#import "TesterCoverFlowViewController.h"
@implementation TesterCoverFlowViewController
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) ||
(interfaceOrientation == UIInterfaceOrientationLandscapeRight));
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
}
- (void)dealloc
{
[super dealloc];
}
- (IBAction)done:(id)sender
{
[[self parentViewController] dismissModalViewControllerAnimated:YES];
}
/************************************************************************/
/* */
/* FlowCover Callbacks */
/* */
/************************************************************************/
- (int)flowCoverNumberImages:(FlowCoverView *)view
{
return 64;
}
- (UIImage *)flowCover:(FlowCoverView *)view cover:(int)image
{
switch (image % 6) {
case 0:
default:
return [UIImage imageNamed:@"a.png"];
case 1:
return [UIImage imageNamed:@"b.png"];
case 2:
return [UIImage imageNamed:@"c.png"];
case 3:
return [UIImage imageNamed:@"x.png"];
case 4:
return [UIImage imageNamed:@"y.png"];
case 5:
return [UIImage imageNamed:@"z.png"];
}
}
- (void)flowCover:(FlowCoverView *)view didSelect:(int)image
{
NSLog(@"Selected Index %d",image);
}
@end
Most of the code is taken from the site.
Do I need to do anything to the interface? Because nothing appears! no errors, I just don't see any coverflow (or flowcover).
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您没有看到任何错误,则很可能缺少委托或未呈现视图。
您是否用诸如
presentModalViewController
之类的东西来显示UIViewController
?您是否将
TesterCoverFlowViewController
类指定为FlowCoverView
的委托?If you are not seeing any errors than it is more than likely a missing delegate or the view is not being presented.
Are you showing that
UIViewController
with something likepresentModalViewController
?Did you assign the
TesterCoverFlowViewController
class as the delegate of theFlowCoverView
?