我以编程方式创建了一个 UISCrollView,但我看不到滚动条/指示器。
UIScrollView * contentScrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(760, 70, 205, 320)];
contentScrollView.delegate = self;
contentScrollView.scrollEnabled = YES;
contentScrollView.pagingEnabled = YES;
contentScrollView.userInteractionEnabled=YES;
contentScrollView.scrollsToTop = YES;
contentScrollView.showsVerticalScrollIndicator = NO;
contentScrollView.showsVerticalScrollIndicator = YES;
contentScrollView.alwaysBounceVertical = NO;
contentScrollView.alwaysBounceHorizontal = NO;
contentScrollView.bounces = NO;
contentScrollView.hidden = NO;
[contentScrollView flashScrollIndicators];
UILabel *titleLable = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 205, 40)];
UILabel *subtitleLable = [[UILabel alloc] initWithFrame:CGRectMake(10, 60, 205, 50)];
UITextView * mainContent = [[UITextView alloc]initWithFrame:CGRectMake(10, 110, 205, 230)];
[titleLable setText:@"...."];
[subtitleLable setText:@"SUbtitle"];
[mainContent setText:@"Descritpon"];
[contentScrollView addSubview:mainContent];
[contentScrollView addSubview:titleLable];
[contentScrollView addSubview:subtitleLable];
我将这段代码添加到一个视图中,该视图再次附加到另一个更大的滚动视图。有谁知道为什么会这样?同样为简单起见,我将每个标签包含的文本减少为单词,但在程序中我的文本足以滚动
谢谢..