光标不在UITextView的顶部

时间:2014-02-02 00:30:05

标签: ios text uitextview

我有一个UITextview,但由于某种原因,光标被放置了几行,而不是它应该放在顶部。

这是UITextView:

UITextView *textView = [[UITextView alloc] init];
textView.delegate = self;
textView.frame = CGRectMake(0, 195, 320, 568);
[textView setSelectedRange:NSMakeRange(3, 0)];
textView.editable = YES;
[textView.layer setBorderColor:borderColor.CGColor];
[textView.layer setBorderWidth:.5];
textView.selectedRange = NSMakeRange(2, 0);
textView.backgroundColor = [UIColor whiteColor];
textView.font = [UIFont fontWithName:@"HelveticaNeue" size:17];
textView.textAlignment = NSTextAlignmentCenter;
[self.view addSubview:textView];
[self.view sendSubviewToBack:textView];

0 个答案:

没有答案