对于 ScrollView 滚动问题,您必须scrlViewMain.contentSize
动态增加。创建一个for
循环并将下面的代码放在循环的末尾。
scrlViewMain.contentSize = CGSizeMake(0, incermentAsPerYourNeed);
对于攻丝问题,您必须添加TapGesture
. ImageView
创建时输入以下代码。
imgView.tag = giveAsPerYourRecordsID;
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleImageTap:)];
tap.cancelsTouchesInView = YES;
tap.numberOfTapsRequired = 1;
tap.delegate = self;
[imgView addGestureRecognizer:tap];
[tap release];
并在下面介绍您的点击方法。
- (void) handleImageTap:(UIGestureRecognizer *)gestureRecognizer {
UIImageView *tmpImgView = (UIImageView *)gestureRecognizer.view;
}