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

UIScrollView contentSize 不起作用

UIScrollView contentSize not working(UIScrollView contentSize 不起作用)
本文介紹了UIScrollView contentSize 不起作用的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

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

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

現(xiàn)在,當(dāng)我在 viewDidLoad 方法中執(zhí)行此操作時(shí),它似乎對(duì) contentSize 沒(méi)有影響:

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 與框架相同.這是怎么回事?當(dāng)我關(guān)閉自動(dòng)布局時(shí),這開(kāi)始工作.為什么?

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?

推薦答案

我也遇到了同樣的問(wèn)題.UIScrollView 的自動(dòng)布局搞砸了.

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

解決方法:將 UIScrollView 中的所有內(nèi)容放入另一個(gè) UIView,并將該 UIView 作為 UIScrollView 的唯一子項(xiàng).然后你可以使用自動(dòng)布局.

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.

如果接近尾聲的事情搞砸了(無(wú)論您的 UIScrollView 滾動(dòng)哪個(gè)方向的尾端),請(qǐng)將最后的約束更改為盡可能低的優(yōu)先級(jí).

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.

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

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

相關(guān)文檔推薦

How to subclass UIScrollView and make the delegate property private(如何繼承 UIScrollView 并使委托屬性私有)
Swift - how to get last taken 3 photos from photo library?(Swift - 如何從照片庫(kù)中獲取最后拍攝的 3 張照片?)
Setting contentOffset programmatically triggers scrollViewDidScroll(以編程方式設(shè)置 contentOffset 觸發(fā) scrollViewDidScroll)
Photos app-like gap between pages in UIScrollView with pagingEnabled(使用 pagingEnabled 的 UIScrollView 中頁(yè)面之間的照片應(yīng)用程序式間隙)
why UIScrollView is leaving space from top in ios 6 and ios 7(為什么 UIScrollView 在 ios 6 和 ios 7 中從頂部留下空間)
UIScrollView pauses NSTimer while scrolling(UIScrollView 在滾動(dòng)時(shí)暫停 NSTimer)
主站蜘蛛池模板: 成人深夜福利视频 | 天天爽天天操 | 99久久婷婷国产综合精品草原 | 一级片观看 | 精品国产精品三级精品av网址 | 国产剧情在线 | 91网站免费观看 | 成年人av| 日本免费一级片 | 国产精品av在线 | 激情小说图片视频 | 在线黄色网 | wwwxxx欧美 | 国产免费视频 | 一级特黄aaaaaa大片 | 欧美aaaaa| 国产黄a| 欧美视频久久 | 日日干夜夜干 | 亚洲女优在线 | 久久精品黄色 | 国产视频一区二 | 天天看毛片 | 插插插av | 亚洲天堂一区二区三区 | 日本久久久久 | 99热视 | 超碰在线91| 91狠狠综合 | 91理论片午午伦夜理片久久 | 欧美性久久 | 香蕉一区二区 | 毛片久久| 欧美亚洲激情 | 欧美日韩福利 | www久久久久 | 色婷婷综合在线 | 欧美成人久久 | 91日韩欧美 | 福利视频1000 | 国产日韩精品视频 |