0
如何在linearType ICarousel视图中调整containerView的框架从原点到所需的高度,但它固定在视图中间,如图中所示,如我试图设置框架,如下面的代码所示。如何调整iCarouselTypeLinear视图的框架以移动到顶部
- (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,并且不得不像你一样寻找文档。有一个与iCarousel一起提供的演示应用程序,该应用程序具有滑块,可让您将传送带移动到封闭视图上。看看那个应用程序。 –
看起来像属性是'contentOffset' –