How to use scroll view on 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 上使用滚动视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 iPhone 上使用滚动视图?


基础教程推荐
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01