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

滾動視圖不起作用 IOS 7

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

問題描述

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

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 的子視圖.請指導(dǎo)如何啟用滾動!

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 固定到其父視圖的兩側(cè),如下所述.

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

2) 在 viewDidLayoutSubviews 中設(shè)置滾動視圖的內(nèi)容大小:

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

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

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

1) 如果使用AutoLayout,則不需要設(shè)置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 作為內(nèi)容視圖并將其固定到 UIScrollView 并移動此內(nèi)容視圖中的所有控件:

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) 將內(nèi)容視圖固定到其父滾動視圖,如下所述:

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

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

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

5) 將您的內(nèi)容 UIView 調(diào)整到您想要的高度(顯然也很重要):

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

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

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(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 - 如何從照片庫中獲取最后拍攝的 3 張照片?)
Setting contentOffset programmatically triggers scrollViewDidScroll(以編程方式設(shè)置 contentOffset 觸發(fā) scrollViewDidScroll)
Photos app-like gap between pages in UIScrollView with pagingEnabled(使用 pagingEnabled 的 UIScrollView 中頁面之間的照片應(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 在滾動時暫停 NSTimer)
主站蜘蛛池模板: 日本涩涩视频 | www一级片 | 中文字幕在线播放第一页 | 成人在线播放网址 | 国产操操操 | 亚洲vs天堂| 中文字幕在线观看一区 | 久久新 | 欧美极品少妇xxxxⅹ免费视频 | 91文字幕巨乱亚洲香蕉 | 亚洲一区二区在线播放 | 欧美1区 | 国产免费一区二区 | 亚洲啪啪一区 | 久久精片| 欧美男人天堂 | 美人の美乳で授乳プレイ | 日韩亚洲欧美一区 | 精品丝袜在线 | 九九久久精品 | 99精品欧美一区二区三区 | 日韩在线小视频 | 亚洲国产精品人人爽夜夜爽 | 亚洲精品国产偷自在线观看 | 成人影院在线观看 | 日韩另类视频 | 欧美一区二区三区的 | h视频在线免费看 | 综合久久色 | 久久综合久久综合久久综合 | 欧美一区二区三区大片 | 亚洲精品片 | 亚洲精品一级 | 草久久久 | 夜夜操天天干 | 亚洲欧美中文日韩在线v日本 | 麻豆毛片 | 欧美电影一区 | 91亚洲国产| 2019天天干天天操 | 精品久久久久久久久久久院品网 |