0

ラベル付きのUIScrollViewを追加し、ラベルがさらにある場合は垂直方向にスクロールさせたいのですが、次のコードを追加していますが、スクロールしていません。追加するラベルも5つあります。

ヘッダーファイル内

IBOutlet UIScrollView*scrollView;


    @property(nonatomic,retain) IBOutlet UIScrollView*scrollView;

viewDidLoadの実装ファイル内

     titleLabel = [[UILabel alloc ] initWithFrame:CGRectMake(892,257,206,84)];
 titleLabel.textAlignment =  UITextAlignmentRight;
 titleLabel.textColor = [UIColor blackColor];
 titleLabel.font = [UIFont fontWithName:@"Helvetica" size:14];
 [scrollView addSubview:titleLabel];


titleLabel = [[UILabel alloc ] initWithFrame:CGRectMake(10,20,206,84)];
titleLabel.textAlignment =  UITextAlignmentRight;
titleLabel.textColor = [UIColor blackColor];
titleLabel.font = [UIFont fontWithName:@"Helvetica" size:14];
[scrollView addSubview:titleLabel];


titleLabel1 = [[UILabel alloc ] initWithFrame:CGRectMake(10,110,206,84)];
titleLabel1.textAlignment =  UITextAlignmentRight;
titleLabel1.textColor = [UIColor blackColor];
titleLabel1.font = [UIFont fontWithName:@"Helvetica" size:14];
titleLabel1.text=@"tilte Working Fine";

[scrollView addSubview:titleLabel1];


titleLabel2 = [[UILabel alloc ] initWithFrame:CGRectMake(10,190,206,84)];
titleLabel2.textAlignment =  UITextAlignmentRight;
titleLabel2.textColor = [UIColor blackColor];
titleLabel2.text=@"tilte Working Fine";
titleLabel2.font = [UIFont fontWithName:@"Helvetica" size:14];
[scrollView addSubview:titleLabel2];




titleLabel3 = [[UILabel alloc ] initWithFrame:CGRectMake(10,270,206,84)];
titleLabel3.textAlignment =  UITextAlignmentRight;
titleLabel3.textColor = [UIColor blackColor];
titleLabel3.font = [UIFont fontWithName:@"Helvetica" size:14];
titleLabel3.text=@"tilte Working Fine";

[scrollView addSubview:titleLabel3];


titleLabel4 = [[UILabel alloc ] initWithFrame:CGRectMake(10,360,206,84)];
titleLabel4.textAlignment =  UITextAlignmentRight;
titleLabel4.textColor = [UIColor blackColor];
titleLabel4.font = [UIFont fontWithName:@"Helvetica" size:14];
titleLabel4.text=@"tilte Working Fine";

[scrollView addSubview:titleLabel4];



titleLabel5 = [[UILabel alloc ] initWithFrame:CGRectMake(10,450,206,84)];
titleLabel5.textAlignment =  UITextAlignmentRight;
titleLabel5.textColor = [UIColor blackColor];
titleLabel5.font = [UIFont fontWithName:@"Helvetica" size:14];
titleLabel5.text=@"tilte Working Fine";

[scrollView addSubview:titleLabel5];


titleLabel6 = [[UILabel alloc ] initWithFrame:CGRectMake(10,530,206,84)];
titleLabel6.textAlignment =  UITextAlignmentRight;
titleLabel6.text=@"tilte Working Fine";

titleLabel6.textColor = [UIColor blackColor];
titleLabel6.font = [UIFont fontWithName:@"Helvetica" size:14];
[scrollView addSubview:titleLabel6];
4

1 に答える 1

0

コンテンツサイズがスクロールするフレームサイズよりも大きい場合は、スクロールビューのコンテンツサイズをフレームサイズとは異なる大きさにする必要があります。

于 2013-02-15T05:28:14.417 に答える