我想在UIScrollview
上添加UITextView
。然後將UIScrollView
添加到UIView
。添加scrollView到UIView
工作,但將UITextView
添加到UISCrollView
不起作用。任何指針?在UIScrollView上添加UITextView/UILabel
感謝
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];
哦,所以拉布勒的位置是相對的UIScrollView?我認爲這是相對於主屏幕。安斯是有效的。謝謝:) – CodeGeek123
沒有。它應該是相對於每個事物的父/超視圖 – Saad