CoverFlow 多个视图

发布于 2024-09-29 20:56:38 字数 1420 浏览 7 评论 0原文

早上好,

我在下面的代码中遇到了一个大问题并且没有解决方案,所以我希望有人可以 帮助我:

- (IBAction)goToChart {
    [rootViewController switchViews];
}
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    [super viewDidLoad];
    UIButton *weiter = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    weiter.frame = CGRectMake(100, 400, 120, 40);
    [weiter addTarget:self action:@selector(goToChart) forControlEvents:UIControlEventTouchUpInside];
    NSString *ansicht = @"Weiter";
    [weiter setTitle:ansicht forState:UIControlStateNormal];
    [self.view addSubview:weiter];
    // loading images into the queue

    loadImagesOperationQueue = [[NSOperationQueue alloc] init];

    NSString *imageName;
    for (int i=0; i < 10; i++) {
        imageName = [[NSString alloc] initWithFormat:@"cover_%d.jpg", i];
        imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:imageName]];
        UIImage *aktuellesImage = imageView.image;
        UIImage *scaledImage = [aktuellesImage scaleToSize:CGSizeMake(100.0f, 100.0f)];
        [(AFOpenFlowView *)self.view setImage:scaledImage forIndex:i];
        [imageName release];
        NSLog(@"%d is the index",i);

    }
    [(AFOpenFlowView *)self.view setNumberOfImages:10];


}

所以你可以在这个 CoverFlowView 中看到 10 张图像,但是我怎样才能找到前面的实际图片,以便在另一个视图中使用它?

有人可以帮我吗?

问候马可

Good Morning at all,

i have a big problem in the following code and no solution, so i hope someone could
help me:

- (IBAction)goToChart {
    [rootViewController switchViews];
}
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    [super viewDidLoad];
    UIButton *weiter = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    weiter.frame = CGRectMake(100, 400, 120, 40);
    [weiter addTarget:self action:@selector(goToChart) forControlEvents:UIControlEventTouchUpInside];
    NSString *ansicht = @"Weiter";
    [weiter setTitle:ansicht forState:UIControlStateNormal];
    [self.view addSubview:weiter];
    // loading images into the queue

    loadImagesOperationQueue = [[NSOperationQueue alloc] init];

    NSString *imageName;
    for (int i=0; i < 10; i++) {
        imageName = [[NSString alloc] initWithFormat:@"cover_%d.jpg", i];
        imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:imageName]];
        UIImage *aktuellesImage = imageView.image;
        UIImage *scaledImage = [aktuellesImage scaleToSize:CGSizeMake(100.0f, 100.0f)];
        [(AFOpenFlowView *)self.view setImage:scaledImage forIndex:i];
        [imageName release];
        NSLog(@"%d is the index",i);

    }
    [(AFOpenFlowView *)self.view setNumberOfImages:10];


}

So you can see there 10 Images in this CoverFlowView, but how could i find out the ACTUAL picture that is in front, to use this in another view??

Could someone help me, please?

Greetings Marco

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

岁月静好 2024-10-06 20:56:38
-(void)openFlowView: (AFOpenFlowView *)openFlowView imageSelected:(int)index
{
    AppDelegate_iPhone *appDelegate = (AppDelegate_iPhone *)[[UIApplication sharedApplication]delegate];

db_detail = (DB_data *)[self.GalleryArray objectAtIndex:index];


    appDelegate.Id = db_detail.Id;
//  NSLog(@"id: value is %d",db_detail.Id);
//  NSLog(@"Name vlaue is: %@",db_detail.Name);
    appDelegate.title = db_detail.Name;


    DetailMovieViewController *ViewController = [[DetailMovieViewController alloc]init];
    [self.navigationController pushViewController:ViewController animated:YES ];
    [ViewController release];

    [db_detail release];
} 
-(void)openFlowView: (AFOpenFlowView *)openFlowView imageSelected:(int)index
{
    AppDelegate_iPhone *appDelegate = (AppDelegate_iPhone *)[[UIApplication sharedApplication]delegate];

db_detail = (DB_data *)[self.GalleryArray objectAtIndex:index];


    appDelegate.Id = db_detail.Id;
//  NSLog(@"id: value is %d",db_detail.Id);
//  NSLog(@"Name vlaue is: %@",db_detail.Name);
    appDelegate.title = db_detail.Name;


    DetailMovieViewController *ViewController = [[DetailMovieViewController alloc]init];
    [self.navigationController pushViewController:ViewController animated:YES ];
    [ViewController release];

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