如何在 iPhone 上使用滚动视图?

How to use scroll view on iPhone?(如何在 iPhone 上使用滚动视图?)
本文介绍了如何在 iPhone 上使用滚动视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我想显示一个包含很多行的文本.我在滚动视图中添加了一个多行标签,但它没有显示任何内容.看起来这不是使用滚动视图的正确方法.如何使用滚动视图让用户可以向下拖动以查看更多文本?

I want to display a text with a lot of lines. I added a multiline-label to a scroll view, but it didn't show anything. Looks like this is not the correct way to use the scroll view. How to use scroll view so that users can drag down to see more text?

推荐答案

你可以只使用 UITextView.它是 UIScrollView 的子视图,如果将其 text 属性设置为超出其框架的文本量,则视图将变为可滚动的.

You can just use a UITextView. It's a child of UIScrollView, and if you set it's text property to an amount of text that does not fit within it's frame, the view will become scrollable.

这篇关于如何在 iPhone 上使用滚动视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)
Cocos2d - How to check for Intersection between objects in different layers(Cocos2d - 如何检查不同层中对象之间的交集)
Highlight Read-Along Text (in a storybook type app for iPhone)(突出显示朗读文本(在 iPhone 的故事书类型应用程序中))
Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)
How to convert 32 bit PNG to RGB565?(如何将 32 位 PNG 转换为 RGB565?)
Proper cocos2d scene restart?(正确的 cocos2d 场景重启?)