UITextView自动完成气泡位置

在UITextView中输入数据时,我对自动完成气泡定位感到困惑。

我所观察到的是,根据其框架的来源,自动完成的气泡要么位于顶部,要么位于底部。 如果scrollEnabled设置为NO ,则没有固定位置。

这是两个链接。 代码是用init()编写的

iOS Simulator Screen shot 12-Mar-2012 2.35.56 PM

UIView *view = [[[UIView alloc] initWithFrame:CGRectMake(0, 150, 320, 41)] autorelease]; view.backgroundColor = [UIColor grayColor]; [self.view addSubview:view]; UITextView *growingTextView = [[UITextView alloc] initWithFrame:CGRectMake(0, 10, 200, 27)]; growingTextView.font = [UIFont fontWithName:@"Helvetica" size:13]; growingTextView.scrollEnabled = NO; [view addSubview:growingTextView]; 

iOS Simulator Screen shot 12-Mar-2012 2.35.26 PM

  UIView *view = [[[UIView alloc] initWithFrame:CGRectMake(0, 50, 320, 41)] autorelease]; view.backgroundColor = [UIColor grayColor]; [self.view addSubview:view]; UITextView *growingTextView = [[UITextView alloc] initWithFrame:CGRectMake(0, 10, 200, 27)]; growingTextView.font = [UIFont fontWithName:@"Helvetica" size:13]; growingTextView.scrollEnabled = NO; [view addSubview:growingTextView]; 

谁能解释这种观察到的行为?

我知道弹出窗口和气泡总是会自动调整它的位置以方便使用。 它已经在Apple的代码和两个图像中,泡沫位置是有道理的。