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

滾動視圖不起作用 IOS 7

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

問題描述

我有一個滾動視圖,里面有 20 個 UItextview.滾動視圖不起作用.我在 viewdidload 中設置了以下內容.

I have a scrollview inside which i have 20 UItextviews. The scrollview is not working. I have set the following in viewdidload.

self.MainScroll.contentSize = CGSizeMake(320, 1800);

它仍然不滾動.但是,如果我垂直彈跳,它只會彈跳.我的滾動視圖是尺寸為 320*600 的主 UIview 的子視圖.請指導如何啟用滾動!

Still it doesn't scroll. However, if i give bounce vertically, it just bounces. My scrollview is a child of the main UIview of dimension 320*600. Please guide how to enable the scroll!!

推薦答案

有兩種方法可以讓滾動工作.

There are two ways you can get the scrolling to work.

方法一(帶代碼):

1) 將 UIScrollView 固定到其父視圖的兩側,如下所述.

1) Pin UIScrollView to the sides of its parent view, as mentioned below.

2) 在 viewDidLayoutSubviews 中設置滾動視圖的內容大小:

2) Set content size of your scroll view in viewDidLayoutSubviews:

- (void)viewDidLayoutSubviews {
    self.MainScroll.contentSize = CGSizeMake(320, 1800);
}

方法 2(純 IB,無需代碼):

1) 如果使用AutoLayout,則不需要設置contentSize.您需要將 UIScrollView 固定到父視圖,如下所述:

1) Setting contentSize is not required if using AutoLayout. You need to pin your UIScrollView to the parent view as mentioned below:

2) 然后在 UIScrollView 中添加另一個 UIView 作為內容視圖并將其固定到 UIScrollView 并移動此內容視圖中的所有控件:

2) Then add another UIView inside UIScrollView to act as a content view and pin it to the UIScrollView and move all controls inside this content view:

3) 將內容視圖固定到其父滾動視圖,如下所述:

3) Pin content view to its parent scroll view as mentioned below:

4) 將 UIViewController 的模擬指標設置為自由形式(這很重要):

4) Set your UIViewController's Simulated Metrics to Freeform (this is important):

5) 將您的內容 UIView 調整到您想要的高度(顯然也很重要):

5) Size your content UIView to your desired height (obviously important too):

Apple 文章解釋 UIScrollView 和 AutoLayouts:https://developer.apple.com/library/content/technotes/tn2154/_index.html

Apple article explaining UIScrollView and AutoLayouts: https://developer.apple.com/library/content/technotes/tn2154/_index.html

這篇關于滾動視圖不起作用 IOS 7的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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)
主站蜘蛛池模板: 久久伊人操 | 一区二区三区在线观看视频 | 亚洲激情在线观看 | 久久99深爱久久99精品 | caoporn国产精品免费公开 | 欧美精品一区在线发布 | 成人性生交大免费 | 日韩成人国产 | 羞羞视频在线观免费观看 | 欧美色综合天天久久综合精品 | 久久国 | 国产成人网 | 日韩一区二区av | 黄频视频 | 中文字幕在线二区 | 男人的天堂久久 | 99精品国产成人一区二区 | 欧美成人一区二区 | 日韩久久中文字幕 | 国产三级精品三级在线观看四季网 | 中文字幕免费在线观看 | 免费观看毛片 | 欧美亚洲国产日韩 | 欧美大片黄 | 久久久免费毛片 | 久久久久国产 | 久久无毛| 久久久在线视频 | 国产福利资源在线 | 亚洲午夜av | 欧美日韩电影在线 | 久久av.com| 亚洲欧美日韩精品久久亚洲区 | 一区二区三区免费 | 日本三级电影免费观看 | 精品欧美一区二区中文字幕视频 | 日本精品一区二区三区视频 | 成人a视频片观看免费 | 全免费a级毛片免费看视频免 | 国产成人一区二 | 狠狠的日 |