Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

记录ScrollView的使用方法 #7

Closed
WDDcat opened this issue Mar 6, 2020 · 0 comments
Closed

记录ScrollView的使用方法 #7

WDDcat opened this issue Mar 6, 2020 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@WDDcat
Copy link
Owner

WDDcat commented Mar 6, 2020

  1. 在rootView中添加一个UIScrollView
  2. 把ScrollView调整好大小
  3. 设置ScrollView的constraint附着在safe area上
  4. 在ScrollView中添加一个View
  5. 将View拉满充满ScrollView
  6. 将View的左上两条边添加constraint到Content Layout Guide,右下两条边添加constraint到Frame Layout Guide
  7. 在View中布局,设置的约束全部依靠至View(即super View)上
  8. 在Controller代码中复写viewWillAppear
    override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) self.baseScrollView.contentSize = CGSize(width: self.view.frame.size.width, height: self.view.frame.size.height + 50) }
    具体添加的数值试底部内边距而定
@WDDcat WDDcat added the documentation Improvements or additions to documentation label Mar 6, 2020
@WDDcat WDDcat changed the title 记录ScrollView 记录ScrollView的使用方法 Mar 6, 2020
@WDDcat WDDcat closed this as completed Mar 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant