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' –