FlowCover 问题目标 C

发布于 2024-09-16 06:24:33 字数 1913 浏览 10 评论 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)。

谢谢

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

半透明的墙 2024-09-23 06:24:33

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

您是否用诸如 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 like presentModalViewController?

Did you assign the TesterCoverFlowViewController class as the delegate of the FlowCoverView?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文