我想显示一个包含很多行的文本.我在滚动视图中添加了一个多行标签,但它没有显示任何内容.看起来这不是使用滚动视图的正确方法.如何使用滚动视图让用户可以向下拖动以查看更多文本?
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 上使用滚动视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
iOS UIScrollView 延迟加载iOS UIScrollView Lazy Loading(iOS UIScrollView 延迟加载)
如何使用或不使用 ScrollView 使 ImageView 可缩放?how to make an ImageView zoomable with or without ScrollView.?(如何使用或不使用 ScrollView 使 ImageView 可缩放?)
如何在 iphone 应用程序开发中的导航栏上添加 1How can i add more than 10 buttons on a navigationbar in iphone application development?(如何在 iphone 应用程序开发中的导航栏上添加 10
UIScrollView 只能用一根手指滚动UIScrollView scrolling only with one finger(UIScrollView 只能用一根手指滚动)
在 UIScrollView 中使用 UITouchUsing UITouch inside a UIScrollView(在 UIScrollView 中使用 UITouch)
UitextField resignFirstResponder 在滚动视图中不起作用UitextField resignFirstResponder does not work in scroll view(UitextField resignFirstResponder 在滚动视图中不起作用)