UITextView 自动完成气泡位置 [英] UITextView auto-complete bubble location

查看:27
本文介绍了UITextView 自动完成气泡位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am confused regarding auto-complete bubble location while entering data in UITextView.

我观察到的是,根据其框架的原点,自动完成气泡要么出现在顶部,要么出现在底部.没有固定位置,前提是scrollEnabled设置为NO.

What i have observed is that depending upon its frame's origin , auto-complete bubble either comes on top or bottom. There is no fixed location, provided scrollEnabled is set to NO.

这是两个链接.代码写在 init()

Here are the two links. Code is written in init()

http://www.flickr.com/photos/26021742@N00/6975525835/

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];

http://www.flickr.com/photos/26021742@N00/6975525727/

    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];

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

Can anyone explain this observed behavior ???

推荐答案

我知道弹出框和气泡总是会自动调整其位置以方便使用.它已经在 Apple 的代码中,并且在两张图片中气泡位置都有意义.

I know that popovers and bubbles will always automatically adjust it's position for ease of use. It's already on Apple's code and in both images the bubble position makes sense.

这篇关于UITextView 自动完成气泡位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆