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

滾動(dòng)視圖不起作用 IOS 7

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

問(wèn)題描述

我有一個(gè)滾動(dòng)視圖,里面有 20 個(gè) UItextview.滾動(dòng)視圖不起作用.我在 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);

它仍然不滾動(dòng).但是,如果我垂直彈跳,它只會(huì)彈跳.我的滾動(dòng)視圖是尺寸為 320*600 的主 UIview 的子視圖.請(qǐng)指導(dǎo)如何啟用滾動(dòng)!

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!!

推薦答案

有兩種方法可以讓滾動(dòng)工作.

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è)置滾動(dòng)視圖的內(nèi)容大小:

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

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

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

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 中添加另一個(gè) UIView 作為內(nèi)容視圖并將其固定到 UIScrollView 并移動(dòng)此內(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)容視圖固定到其父滾動(dòng)視圖,如下所述:

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)于滾動(dòng)視圖不起作用 IOS 7的文章就介紹到這了,希望我們推薦的答案對(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)
主站蜘蛛池模板: 欧美日韩一区二区三区视频 | 亚洲天堂国产 | 亚洲欧美国产精品 | 国产一区精品视频 | 天天射天天舔 | 亚洲国产精品久久久久久久 | 久久香蕉精品 | 精品一区二区三区免费 | 欧美日韩高清在线 | 日本免费黄色 | 欧美xx孕妇 | 免费a网站 | 国产免费无遮挡 | 久久精品一区二区三区四区 | 黄色免费一级片 | 国产香蕉视频 | 日韩精品免费视频 | 日日日操操操 | 一级黄色免费 | 日韩在线综合 | 国产黄色免费看 | 久久久久亚洲精品 | 超碰99在线 | 亚洲天堂男人 | 国产xxxx视频 | 中文字幕免费高清 | 伊人网在线 | 91精品国产一区二区三区 | 日韩大片在线观看 | 婷婷97| 真实的国产乱xxxx在线 | 国产三区在线观看 | 亚洲网站在线 | 国产精品主播一区二区 | 精品视频久久 | 国产日韩亚洲 | 国产日本在线观看 | 日韩美女在线 | 国产精品视频免费在线观看 | 亚洲久热 | 亚洲亚洲人成综合网络 |