【发布时间】:2016-05-29 13:05:22
【问题描述】:
我无法理解如何将我的视图嵌入到具有动态高度的滚动视图中。我之前已经设法创建滚动视图,但仅具有静态高度。例如,Facebook 或 Instagram 等 iPhone 应用程序如何设法为整个动态高度数据提要创建滚动视图。到目前为止,我已经使用故事板来创建滚动视图,但我假设在代码中完成会更好。
class connectDetailsViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
//set up variables with data
fillData()
}
override func viewWillAppear(animated: Bool) {
let nameTitleString = String(businesses[businessNum]["name"]!)
nameTitle.text = nameTitleString
processTimes() // Adds information for the hours of operation, if applicable
processDetails() //Adds information for the details if possible (a few sentences to a few paragraphs)
}
}
processDetails() 和 ProcessTimes() 将编辑堆栈视图中的内容,如何创建滚动视图以在正确的高度包含这两个堆栈视图?
【问题讨论】:
标签: xcode swift scrollview