gpt4 book ai didi

ios - UIScrollView 不滚动 Swift 3

转载 作者:行者123 更新时间:2023-11-30 12:25:24 25 4
gpt4 key购买 nike

我已经禁用了所有自动布局,但它仍然无法滚动。我上面有很多 UIButton,它们都链接到要单击的 Segue,以便可以转到下一页。我还没有为 UIScrollView 添加任何代码,我不确定你是否添加了。这是 ScrollView 场景的屏幕截图和代码,

   @IBAction func derecourtButton(_ sender: Any) {

self.performSegue(withIdentifier: "classtoperiod", sender: self)

}


@IBAction func myburghButton(_ sender: Any) {

self.performSegue(withIdentifier: "classtoperiod", sender: self)

}


@IBAction func edmondsonButton(_ sender: Any) {

self.performSegue(withIdentifier: "classtoperiod", sender: self)

}


@IBAction func healyButton(_ sender: Any) {

self.performSegue(withIdentifier: "classtoperiod", sender: self)

}


@IBAction func bormansButton(_ sender: Any) {

self.performSegue(withIdentifier: "classtoperiod", sender: self)

}


@IBAction func jackwaysButton(_ sender: Any) {

self.performSegue(withIdentifier: "classtoperiod", sender: self)

}

@IBAction func horrackButton(_ sender: Any) {

self.performSegue(withIdentifier: "classtoperiod", sender: self)

}


@IBAction func mchughButton(_ sender: Any) {

self.performSegue(withIdentifier: "classtoperiod", sender: self)

}


@IBAction func youngButton(_ sender: Any) {

self.performSegue(withIdentifier: "classtoperiod", sender: self)

}


@IBAction func mitchellButton(_ sender: Any) {

self.performSegue(withIdentifier: "classtoperiod", sender: self)

}


@IBAction func testerButton(_ sender: Any) {

self.performSegue(withIdentifier: "classtoperiod", sender: self)

}


@IBAction func parrButton(_ sender: Any) {

self.performSegue(withIdentifier: "classtoperiod", sender: self)

}


@IBAction func holdenButton(_ sender: Any) {

self.performSegue(withIdentifier: "classtoperiod", sender: self)

}

这是 main.storyboard 的屏幕截图:http://i.imgur.com/IPO3u0n.png

编辑:我还需要每个按钮都有一个像电子邮件这样的值,因为它会向您在菜单上选择的任何人发送一封电子邮件。假设您选择数学,它会将电子邮件收件人设置为“mathteacher@gmail.com”,依此类推。

最佳答案

试试这个:

override func viewDidLayoutSubviews() {
scrollView.scrollEnabled = true
scrollView.contentSize = CGSizeMake(scrollview's width, 2300) // height should be grater than scrollview's frame height
}

关于ios - UIScrollView 不滚动 Swift 3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44278871/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com