2017-01-09 6 views
0

linearType ICarouselでコンテナビューのフレームを調整する方法原点から必要な高さにビューを移動します。ただし、図のようにビューの中央に固定します。私は下のコードのようにフレームを設定しようとしました。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; 
} 

Pleae click here to view image

答えて

1

iCarouselsには、カルーセルの配置、3D角度、その他のパラメータを調整するためのさまざまな設定があります。カルーセルを上下に動かすことができる設定があります。ドキュメントをチェックしてください。

+0

名前を付けて(設定名)、私は試しましたが、何も見つかりませんでした。 –

+0

私はiCarouselを1年以上使っておらず、あなたと同じようにドキュメントを捜す必要があります。 iCarouselに同梱されているデモアプリケーションがあります。このアプリケーションには、周囲にカルーセルを囲むスライダーがあります。そのアプリを見てみましょう。 –

+0

プロパティが 'contentOffset'のように見える –

関連する問題