在Storyboards中,TableViews有一个名为"Index Row Limit"的属性字段.默认值为2.我找不到任何关于这是什么的信息.一个谷歌搜索返回结果的单页和结果的一半为非英语.有谁知道这个领域是什么?
我有一个水平滚动视图填充UIImageViews.
我想检测一下UIImageView它的背景并改变其背景颜色.
不知何故,敲击手势不起作用.
但是,当我向滚动视图添加点击手势时,它可以正常工作.该scrollview.background color是可以改变的.
但我想检测UIImageViews它包含的点击!
UIScrollView* scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 50, 768, 127)];
[scrollView setScrollEnabled:YES];
scrollView.backgroundColor = [UIColor orangeColor];
[scrollView setShowsHorizontalScrollIndicator:NO];
UIImageView *contentOfScrollView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 1, 1130, 125)];
scrollView.contentSize = CGSizeMake(contentOfScrollView.frame.size.width, contentOfScrollView.frame.size.height);
for (int aantal=0; aantal < 6; aantal++) {
UIImageView *item = [[UIImageView alloc] initWithFrame:CGRectMake(3+(aantal*188), 0, 185, 125)];
item.backgroundColor = [UIColor yellowColor];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:item action:@selector(imageTapped:)];
tap.numberOfTapsRequired = 1;
tap.cancelsTouchesInView=YES;
item.userInteractionEnabled = YES;
[item addGestureRecognizer:tap]; …Run Code Online (Sandbox Code Playgroud) cocoa-touch ×1
ios ×1
uiimageview ×1
uikit ×1
uiscrollview ×1
uistoryboard ×1
uitableview ×1
xcode ×1