私は 2scrollviews
と 1を持っていimageview
ます。
今、メインのscrollview
中に別のものがあります。scrollview
これscrollview
にはイメージがあります。
つまり、「 」という名前のメインScrollview
と「」という名前ScrollView
のサブscrollview
scrView
scrView
" " 内に " "を追加できるようになりましたが、" "内ScrollView
に自分のイメージが表示されません。scrView
私のコーディングは次のとおりです。
int numberOfPages = 10;
[scrollView setPagingEnabled:YES];
[scrollView setContentSize:CGSizeMake(scrollView.bounds.size.width * numberOfPages, scrollView.bounds.size.height)];
CGRect pageFrame;
CGRect imageFrame;
UIImageView *imageView;
for(int i=0; i < numberOfPages; i++)
{
pageFrame = CGRectMake(i * scrollView.bounds.size.width+50, 0.0f, scrollView.bounds.size.width-100, scrollView.bounds.size.height);
UIScrollView *scrView = [[UIScrollView alloc] init];
imageFrame = CGRectMake(i * scrView.bounds.size.width, 0.0f, scrView.bounds.size.width, scrView.bounds.size.height);
imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"image1.jpg"]];
[scrView setFrame:pageFrame];
[imageView setFrame:imageFrame];
[scrView setBackgroundColor:[UIColor redColor]];
[scrollView addSubview:scrView];
[scrView addSubview:imageView];
[imageView release];
}
imageView
として追加したコードを見るとsubView
、scrView
シミュレーターで画像を見ることができません。
何が問題ですか?
あなたのアイデアを私と共有してください。
ありがとう...