我试图在Scrollview中插入TextView。滚动视图的工作,但TextView的内容不完整,因为出现他们的滚动。我会显示完整的TextView内容而不滚动。ScrollView中的TextView自动高亮
file.h
@interface DetailViewController : UIViewController{
IBOutlet UITextView *detailTextView;
IBOutlet UIScrollView *scroller;
}
@property(retain, nonatomic) IBOutlet UIScrollView *scroller;
-(void)setTextViewForRecipes: (Recipe *)theRecipe;
@end
file.m
@implementation DetailViewController
@synthesize scroller;
-(void) setTextViewForRecipe:(Recipe *)theRecipe
{
[detailTextView setText:theRecipe.detail];
}
- (void)viewDidLoad {
CGRect frame = detailTextView.frame;
frame.size.height = detailTextView.contentSize.height;
detailTextView.frame = frame;
[scroller setContentSize: CGSizeMake(280, detailTextView.frame.origin.y + detailTextView.frame.size.height + 10)];
}