[英]iOS : Scrollview and Autolayout, second view not extending
當我第一次學習Autolayout時,情況還不錯,因為您只有1種寬度可以應付。 我正在努力使Scrollview隨設備(寬度)及其內容的增長而平均增長。 滾動視圖上有分頁,所以我相信StackView是不可能的。
當前的問題是第一個視圖的寬度增長到正確的寬度(我相信它會縮小到centerX),但是scrollview的整體內容大小不夠大(iPhone 6),secondview的寬度只有320。
我可以在代碼中執行此操作,但是我確定您不需要這樣做。
我嘗試了很多選擇,例如說大於寬度
據我了解您的問題,您想在滾動視圖內自動調整視圖的大小。 因此,您應該在目標視圖中添加“ 等寬約束 ”,而不是創建寬度約束:
第二步
如果scrollview告訴您它具有模糊的可滾動內容,請為其添加底部約束。
基本上,如果需要在滾動視圖內進行自動布局,則應提供contentView並將其設置為滾動視圖的尾部,前導,頂部,底部約束:
該技巧使您可以在scrollview中添加另一個對象並輕松使用自動布局。
希望這可以幫助
[英]iOS AutoLayout with scrollview and keyboard
[英]iOS AutoLayout issue with ScrollView
[英]ios autolayout architecture tips for scrollview
[英]ScrollView not working in iOS7 with AutoLayout
[英]ScrollView with multiple Views iOS Autolayout
[英]iOS Autolayout for scrollview and sticky footer
[英]Ios horizontal scrollview and autolayout issue
[英]ios how to setup a scrollview with autolayout?
[英]a view disappear in autolayout, ios
[英]Floating view into second row with autolayout
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.