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

故事板中的 UIScrollView 不能與 iOS 8 大小類和自動

UIScrollView in Storyboard not working with iOS 8 Size Classes and Autolayout(故事板中的 UIScrollView 不能與 iOS 8 大小類和自動布局一起使用)
本文介紹了故事板中的 UIScrollView 不能與 iOS 8 大小類和自動布局一起使用的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

所以我試圖只在情節提要中創建一個 UIScrollView,它允許我添加超過 VC 高度的滾動標簽.這是我所做的:

So I'm trying to create a UIScrollView only in storyboard that allows me to add scrolling labels for more than the height of the VC. Here's what I did:

  1. 創建的UIScrollView占據任意寬度任意高度VC的大小

  1. Created UIScrollView that took up the size of the any width any height VC

在頂部、底部、左側和右側設置了與最近鄰居的間距為 0

Made constraints 0 for spacing to nearest neighbor on top, bottom, left, and right

創建了一個 UIScrollViewsubView 視圖,其寬度與任意寬度任意高度 VC 相同,但高度為 1500(因為我只想要它垂直滾動).

Created a view that is a subView of the UIScrollView with the same width as the any width any height VC but height of 1500 (because I only want it to scroll vertically).

將最近鄰的約束設置為 0,僅用于左側、頂部和右側,并將高度約束設置為 1500.

Set constraints to nearest neighbor as 0 for ONLY left, top, and right and set the height constraint as 1500.

我在subView的頂部和底部放了一個標簽

I put a label at the top of the subView and at the bottom

當我在 iPhone 6 上運行該應用程序時,不會像我想要的那樣垂直滾動.任何想法為什么這不起作用?提前致謝.

When I run the app on an iPhone 6, does not scroll vertically as I want it to. Any ideas why this is not working? Thanks in advance.

推薦答案

要獲得滾動,您必須將子視圖(內容視圖")固定到滾動視圖的頂部、左側、底部和右側.此外,您必須給它(給內容視圖")一個明確的(=與滾動視圖無關)高度和寬度,因為滾動視圖使用這些來計算其內容大小.在您的情況下,將寬度設置為 VC 主視圖寬度,將高度設置為 1500.當寬度或高度大于滾動視圖大小時,它將滾動.

To obtain the scroll you have to pin the sub view (the "content view") to the top, left, bottom and right of the scrollview. In addition you have to give it (to the "content view") an explicit (=not related to the scroll view) height and width because these are used by the scrollview to calculate its content size. In your case set the width equal to the VC main view width and the height to 1500. When width or height are bigger than the scrollview size, it will scroll.

滾動視圖約束(固定到主視圖)

Scroll view constraints (pinned to main view)

內容視圖(固定到滾動視圖 + 高度 1500,寬度=主視圖寬度)+ 標簽約束(例如:內容視圖左上角 20 20)

Content view (pinned to scrollview + height 1500, width=mainview width) + label constraints (as an example: 20 20 from content view top left)

這篇關于故事板中的 UIScrollView 不能與 iOS 8 大小類和自動布局一起使用的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

相關文檔推薦

iOS - Using storyboard and autolayout to center the UIScrollView(iOS - 使用故事板和自動布局使 UIScrollView 居中)
get index or tag value from imageview tap gesture(從 imageview 點擊手勢獲取索引或標簽值)
UIScrollView not scrolling regardless of large contentSize(無論內容大小如何,UIScrollView 都不會滾動)
Clean autorotation transitions in a paging UIScrollView(清除分頁 UIScrollView 中的自動旋轉轉換)
UIScrollView zooming with Auto Layout(UIScrollView 使用自動布局縮放)
How to create an image from a UIView / UIScrollView(如何從 UIView/UIScrollView 創建圖像)
主站蜘蛛池模板: 午夜寂寞影院列表 | 午夜伦4480yy私人影院 | 国产精品久久久久久一区二区三区 | 久久国产精品99久久久久久丝袜 | 91精品亚洲 | 麻豆久久久9性大片 | 视频精品一区二区三区 | 国产精品久久久久久 | 亚洲国产aⅴ成人精品无吗 亚洲精品久久久一区二区三区 | 男女视频在线看 | 精品国产乱码久久久久久丨区2区 | 91亚洲国产精品 | 免费毛片网站 | 韩日有码 | 欧美精品福利视频 | 国产精品一区二区视频 | 欧美综合自拍 | 国产精品一区二区三区在线 | 亚洲精品中文字幕在线观看 | 欧美激情a∨在线视频播放 成人免费共享视频 | 亚洲国产91 | 久久久久久久久99精品 | 日韩精品在线观看一区二区 | 日韩欧美专区 | 超碰在线影院 | 中文字幕精品一区二区三区精品 | 亚洲精品久久久一区二区三区 | 亚洲成人蜜桃 | 成人av一区二区亚洲精 | 精品国产91乱码一区二区三区 | chengrenzaixian| 国产成人综合在线 | 韩日精品一区 | 少妇性l交大片免费一 | 国产91久久久久久久免费 | 在线免费看91 | 春色av | 亚洲视频一区在线 | 亚洲国产精品一区二区三区 | 91精品在线观看入口 | 久久久青草婷婷精品综合日韩 |