iphone - 谁能告诉我如何向 UIScrollView 添加文本的示例?

标签 iphone ios uiscrollview

我见过的大多数代码示例都显示添加的图像。我正在寻找一个示例,该示例基本上只显示大约 10-15 行数据被添加到 UIScrollVIew。

我们将不胜感激任何可靠的建议。

最佳答案

将其放入:viewDidLoad{}

//create UITextView

UITextView *myUITextView = [[UITextView alloc] initWithFrame:CGRectMake(20,188,280,260)];
myUITextView.text = infoText;
myUITextView.textColor = [UIColor lightGrayColor];
myUITextView.font = [UIFont systemFontOfSize:14];
[myUITextView setBackgroundColor:[UIColor clearColor]];
myUITextView.editable = NO;
myUITextView.scrollEnabled = YES;
[Scrollerview addSubview:myUITextView];
[myUITextView release];

'infoText' 是您的文本,'Scrollerview' 是您的 uiScrollView

关于iphone - 谁能告诉我如何向 UIScrollView 添加文本的示例?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5143862/

相关文章:

iphone - 提交到 AppStore 后重命名 iOS App

iphone - 从上传百分比获取上传速度

iphone - OpenGL ES View : how to orient it to landscape?

c# - 如何将参数传递给 NSAction?

ios - 在 iOS 中显示虚拟键盘时固定位置不起作用

ios - 带图像的水平滚动 uicollectionView

ios - UIScrollView 和 touchesBegan/touchesEnded 等

ios - UIScrollview 在 ipad 上不工作

在选择 'download full message' 之前,Html 电子邮件不会显示在 iPhone 邮件中

ios - Sprite 物理在 Swift (SpriteKit) 中显示但未在视觉上显示