【发布时间】:2011-06-08 12:48:57
【问题描述】:
我以编程方式制作了 UITextView,但它没有显示垂直和水平滚动条。我使用的代码如下,
UITextView *txtView = [[UITextView alloc] initWithFrame:CGRectMake(origin, imgFrame.size.height + 10, mScrollView.frame.size.width, 300)];
txtView.font = [UIFont fontWithName:@"HelveticaNeue" size:12];
txtView.textColor = [UIColor blackColor];
txtView.textAlignment = UITextAlignmentLeft;
txtView.editable = NO;
txtView.scrollEnabled = YES;
txtView.backgroundColor = [UIColor clearColor];
[txtView setAutoresizingMask:UIViewAutoresizingFlexibleWidth];
//[txtView flashScrollIndicators];
[txtView setText:[mDescArr objectAtIndex:index]];
[mScrollView addSubview:txtView];
[txtView release];
如何让滚动条显示?
【问题讨论】:
标签: iphone cocoa-touch uitextview