私は 2scrollviewsと 1を持っていimageviewます。
今、メインのscrollview中に別のものがあります。scrollviewこれscrollviewにはイメージがあります。
つまり、「 」という名前のメインScrollviewと「」という名前ScrollViewのサブscrollviewscrView
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シミュレーターで画像を見ることができません。
何が問題ですか?
あなたのアイデアを私と共有してください。
ありがとう...