久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

UIScrollView contentSize 不起作用

UIScrollView contentSize not working(UIScrollView contentSize 不起作用)
本文介紹了UIScrollView contentSize 不起作用的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我在 nib 的 view 中放置了一個 UIScrollView,并將其鏈接到一個 IBOutlet 屬性.

I put a UIScrollView in my nib's view, and linked it to a an IBOutlet property.

現在,當我在 viewDidLoad 方法中執行此操作時,它似乎對 contentSize 沒有影響:

Now, when I do this in my viewDidLoad method, it seems to have no effect on the contentSize:

self.sv.backgroundColor = [UIColor yellowColor]; // this works
CGSize size =  CGSizeMake(1000.0, 1000.0); 
[self.sv setContentSize:size]; // this does not

它的行為就好像 contentSize 與框架相同.這是怎么回事?當我關閉自動布局時,這開始工作.為什么?

It behaves as if the contentSize was the same as the frame. What's going on? This started working when I turned off AutoLayout. Why?

推薦答案

我也遇到了同樣的問題.UIScrollView 的自動布局搞砸了.

I had the same problem. Auto Layout for UIScrollView is messed up.

解決方法:將 UIScrollView 中的所有內容放入另一個 UIView,并將該 UIView 作為 UIScrollView 的唯一子項.然后你可以使用自動布局.

Work around: Put everything in the UIScrollView into another UIView, and put that UIView as the only child of the UIScrollView. Then you can use Auto Layout.

如果接近尾聲的事情搞砸了(無論您的 UIScrollView 滾動哪個方向的尾端),請將最后的約束更改為盡可能低的優先級.

If things near the end is messed up (the end of whichever direction your UIScrollView scrolls), change the constraint at the end to have the lowest possible priority.

這篇關于UIScrollView contentSize 不起作用的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How to subclass UIScrollView and make the delegate property private(如何繼承 UIScrollView 并使委托屬性私有)
Swift - how to get last taken 3 photos from photo library?(Swift - 如何從照片庫中獲取最后拍攝的 3 張照片?)
Setting contentOffset programmatically triggers scrollViewDidScroll(以編程方式設置 contentOffset 觸發 scrollViewDidScroll)
Photos app-like gap between pages in UIScrollView with pagingEnabled(使用 pagingEnabled 的 UIScrollView 中頁面之間的照片應用程序式間隙)
why UIScrollView is leaving space from top in ios 6 and ios 7(為什么 UIScrollView 在 ios 6 和 ios 7 中從頂部留下空間)
UIScrollView pauses NSTimer while scrolling(UIScrollView 在滾動時暫停 NSTimer)
主站蜘蛛池模板: 亚洲精品在线免费播放 | 美女天天操 | 天天爽夜夜爽精品视频婷婷 | 美女福利网站 | 欧美精品第一区 | 国产专区在线 | 国产精品国产a级 | 草久在线 | 91精品国产色综合久久不卡98 | 色网在线观看 | 成人在线观看免费爱爱 | 成人黄色在线 | 亚洲国产成人在线视频 | 亚洲精品国产精品国自产在线 | 久久久国产一区二区三区四区小说 | 国产视频一区二区 | 91精品国产高清一区二区三区 | 国产免费观看一区 | 天天看天天干 | 久久成人一区 | av免费网站在线观看 | 成人午夜看片 | 射久久 | 久久久久国产精品一区二区 | 亚洲天堂久久 | 一区二区三区在线免费观看 | 亚洲第1页 | 欧美乱码精品一区二区三区 | 欧美精品在线一区 | 欧美激情网站 | 日韩三级 | 一级a爱片性色毛片免费 | 久久久久亚洲精品 | 欧美a在线看 | 99在线精品视频 | 农村真人裸体丰满少妇毛片 | 日本色高清 | 欧美日韩视频在线 | 欧美性一区二区三区 | 精品婷婷 | 免费99视频 |