gpt4 book ai didi

ios - 单击后退按钮时,iCarousel 显示在上一页中

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:55:56 25 4
gpt4 key购买 nike

当我按下后退按钮时。 iCarousel 仍然显示 1 秒。为什么会发生这种情况以及如何停止这种情况。我使用 Storyboard创建了 iCarosel View ..

- (void)viewDidUnload
{
[super viewDidUnload];
self.carousel = nil;
}
- (void)dealloc
{
carousel.delegate = nil;
carousel.dataSource = nil;
}

- (NSUInteger)numberOfItemsInCarousel:(iCarousel *)carousel
{
return [idOfAllWords count];
}

- (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index reusingView:(UIView *)view
{
UILabel *label = nil;

//create new view if no view is available for recycling
if (view == nil)
{
view = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 250.0f, 250.0f)];
((UIImageView *)view).image = [UIImage imageNamed:@"page.png"];
view.contentMode = UIViewContentModeCenter;
label = [[UILabel alloc] initWithFrame:view.bounds];
label.backgroundColor = [UIColor clearColor];
label.textAlignment = NSTextAlignmentCenter;
label.font = [label.font fontWithSize:50];
label.tag = 1;
[view addSubview:label];
}
else
{
label = (UILabel *)[view viewWithTag:1];
}
Words *word=nil;
word=idOfAllWords[index];
label.text =word.Name;
return view;
}

enter image description here

最佳答案

隐藏和取消隐藏不是解决方案。你只需要一行:

yourCarousel.clipsToBounds = YES;

关于ios - 单击后退按钮时,iCarousel 显示在上一页中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22279297/

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