我有一个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];