我在 ScrollView (名为parentScrollView)中放置了一些字段+ UITableVIew(名为myTableView)。现在我的 TableView 包含多列,因此由于它是 ScrollView 内的 ScrollView ,我在 ViewDidLoad 中尝试了此操作:
[[self parentScrollView] setContentSize:CGSizeMake(320, 1000)];
self.myTableView.contentSize=CGSizeMake(640,300);
只有parentScrollView垂直滚动而不是myTableView水平滚动,为什么?
最佳答案
这是设计使然
A table view in the UIKit framework is limited to a single column because it is designed for a device with a small screen. UITableView is a subclass of UIScrollView, which allows users to scroll through the table, although UITableView allows vertical scrolling only.
关于iphone - 为什么我的 UItableView 不水平滚动,而我将 ContentSize 设置得更大?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9654416/