gpt4 book ai didi

iphone - 当用户单击 Thumb ViewController 中的拇指时如何显示自定义 View ?

转载 作者:行者123 更新时间:2023-11-29 04:49:23 25 4
gpt4 key购买 nike

我已经使用拇指(来自 json 数据)创建了 TTThumbsViewController,当用户单击拇指时,我的应用程序必须在新的 subview 中打开视频,如下所示:

- (void)thumbsViewController: (TTThumbsViewController*)controller
didSelectPhoto: (id<TTPhoto>)photo
{
NSMutableArray *photoset = [[NSMutableArray alloc] initWithArray:[self.photoSource photos]];
Photo *selected = [photoset objectAtIndex:[photo index]];

NSLog(@"%@", [selected urlLarge]);

NSURL *url = [NSURL URLWithString:[selected urlLarge]];
MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:moviePlayer];

if ([moviePlayer respondsToSelector:@selector(setFullscreen:animated:)]) {
moviePlayer.controlStyle = MPMovieControlStyleDefault;
moviePlayer.shouldAutoplay = YES;
[self.view addSubview:moviePlayer.view];
[moviePlayer setFullscreen:YES animated:YES];
} else {
[moviePlayer play];
}
}

NSLog 显示单击了拇指,但它打开了默认的 TTPhotoViewController :( 我想禁用并仅显示此 subview 。

最佳答案

这可以帮助我解决我的问题

- (void)thumbsTableViewCell:(TTThumbsTableViewCell*)cell didSelectPhoto:(id<TTPhoto>)photo {
[_delegate thumbsViewController:self didSelectPhoto:photo];
}

关于iphone - 当用户单击 Thumb ViewController 中的拇指时如何显示自定义 View ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9121761/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com