我正在尝试添加一个UITextView. UIScrollview然后添加UIScrollView到UIView. 将 scrollView 添加到UIView有效但添加UITextView到 aUISCrollView不起作用。任何指针?
谢谢
UIScrollView * contentScrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(300, 400, 250, 250)];
contentScrollView.backgroundColor = [UIColor whiteColor];
UITextView * mainContent = [[UITextView alloc]initWithFrame:CGRectMake(300, 400, 200, 200)];
mainContent.text = @"HELLO";
mainContent.textColor = [UIColor blackColor];
[contentScrollView addSubview:mainContent];
[contentScrollView setUserInteractionEnabled:YES];
[contentView addSubview:contentScrollView];