0

我正在尝试使用 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)。

谢谢

4

1 回答 1

1

如果您没有看到任何错误,则很可能是缺少委托或未呈现视图。

UIViewController用类似的东西来展示它presentModalViewController吗?

您是否将TesterCoverFlowViewController班级指定为 的代表FlowCoverView

于 2010-08-26T13:45:32.480 回答