iCarouselを使用してカスタムUIViewをCoverFlowモードで表示していますが、アプリを実行すると表示されますが、中には何も表示されません。追加したビューではないようです。だからあなたは私を助けることができますか?
- (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index reusingView:(UIView *)view
{
CustomView *temp;
if (view == nil)
{
//don't do anything specific to the index within
//this `if (view == nil) {...}` statement because the view will be
//recycled and used with other index values later
view = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 315.0f, 350.0f)] autorelease];
temp=[[CustomView alloc] initWithFrame:view.bounds];
temp.backgroundColor=[UIColor redColor];
view.contentMode = UIViewContentModeCenter;
temp.tag=1;
[view addSubview:temp];
}
else
{
//get a reference to the label in the recycled view
temp = (CustomView *)[view viewWithTag:1];
}
//set item label
//remember to always set any properties of your carousel item
//views outside of the `if (view == nil) {...}` check otherwise
//you'll get weird issues with carousel item content appearing
//in the wrong place in the carousel
//label.text = [[items objectAtIndex:index] stringValue];
return view;
}