如何调整 iCarouselTypeLinear 视图移动到顶部的框架

How to adjust the frame for iCarouselTypeLinear view to move to top

如何将linearType ICarousel View中containerView的frame调整到离原点所需的高度,但是它固定在view的中间,如图所示,因为我尝试如下设置frame代码。

- (UIView *)carousel:(__unused iCarousel *)carousel viewForItemAtIndex:(NSInteger)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, [UIObjects widthOfTheElement:267], [UIObjects heightOfTheElement:172])];  
    ((UIImageView *)view).image = [UIImage imageNamed:[self.imagesArray objectAtIndex:index]];  
//        view.contentMode = UIViewContentModeCenter;  
//        view.backgroundColor=[UIColor yellowColor];  
    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];  
if (index==0)   
{  
    label.text = @"ramki";    
}  
else  
{  
}  
return view;  
}  

.

iCarousel 具有多种设置,可让您调整轮播的位置、3D 角度和其他参数。有一个设置可让您在其视图中上下移动轮播。检查文档。