久久久久久久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)
主站蜘蛛池模板: 成人免费视频观看 | 精品国产1区2区3区 一区二区手机在线 | 国产精品视频播放 | 国产98色在线 | 日韩 | 高清亚洲 | 日韩视频在线免费观看 | 精品国产91亚洲一区二区三区www | 亚洲在线成人 | 亚洲 中文 欧美 日韩 在线观看 | 日韩成人在线播放 | 日韩精品无码一区二区三区 | www久久久 | 久久久亚洲综合 | 香蕉一区 | 一区二区三区免费看 | 国产欧美精品一区二区三区 | 亚洲免费视频播放 | 日韩精品人成在线播放 | 精品一区二区av | 91精品国产99 | 国产精品国产a级 | 狠狠爱免费视频 | 天天干成人网 | 日本天堂一区二区 | 国产91在线观看 | 91久久久久久久久 | 网络毛片 | 在线看91 | 国产乱码精品一区二区三区中文 | 国产精品高清在线 | 欧美一区二区三区的 | 久久精品视频网站 | 国产精品一区在线观看 | 久久久av| 国产片一区二区三区 | 一二区电影 | 久久国产精彩视频 | 午夜一区二区三区在线观看 | 亚洲综合色婷婷 | 请别相信他免费喜剧电影在线观看 | 综合久 |