我在滚动视图中创建 1000 个视图。这需要更多时间来加载视图。
wordsDetails *wordsObj;
for(int i = 0; i<arrayOfWords.count;i++) {
UIView *viewForDisplay = [[UIView alloc]initWithFrame:CGRectMake(320*i, 0, 320, 440)];
UILabel *wordLabel = [[UILabel alloc]initWithFrame:CGRectMake(30, 40, 240, 40)];
wordLabel.backgroundColor = [UIColor clearColor];
wordLabel.textColor = [UIColor yellowColor];
wordLabel.font = [UIFont fontWithName:@"Didot" size:24.0];
wordsObj = [arrayOfWords objectAtIndex:i];
wordLabel.text = wordsObj.word;//[NSString stringWithFormat:@"sdssds - %i",i];
[viewForDisplay addSubview:wordLabel];
UITextView *textView = [[UITextView alloc]initWithFrame:CGRectMake(30, 100, 240, 100)];
textView.text = wordsObj.meaning;
textView.editable = NO;
textView.textColor = [UIColor whiteColor];
textView.font = [UIFont fontWithName:@"Didot" size:20.0];
textView.backgroundColor = [UIColor clearColor];
[viewForDisplay addSubview:textView];
[fScrollView addSubview:viewForDisplay];
}
有没有办法在线程中调用它。