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

如何在 Swift 中設置 UIScrollView 高度

How to set UIScrollView Height in Swift(如何在 Swift 中設置 UIScrollView 高度)
本文介紹了如何在 Swift 中設置 UIScrollView 高度的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在使用 swift 構建應用程序.我想使用情節提要向我的視圖控制器添加一些內容.

我已經把所有東西都放在了滾動視圖中并設置了特定的高度,但是當我運行應用程序時,滾動視圖總是設置得比視圖底部的按鈕長

我希望滾動視圖在按鈕之后立即停止

請幫我解決這個問題

謝謝

滾動后

為了您的信息,請忽略 'critics' 和提交按鈕之間的空白,因為實際上它們之間有 UITextView 但不可見(仍然嘗試添加一些邊框)

這些是我的故事板預覽

解決方案

1) ScrollView Contraints

2) ScrollView -> contentView 滾動視圖的約束與上圖相同

3) 現在 ContentView 的寬度和高度約束到主視圖[嵌入了 ScrollView 的 SuperView] 和約束如下.

4) 現在單擊 EqualWidth 以查看 [從頂部開始的第三個約束] 并按照步驟 6 進行編輯

5) contentView 寬度約束

6) ContentView 高度約束//設置優先級 [必須] .在這里,您需要將菜單中的第一項和第二項更改為如圖所示 First as - ContentView.Height 和第二個 as - View.height 并將優先級設置為 250 在此之后,情節提要中將出現一條虛線沿 contentView

7) 現在在 contentView 中添加 [UIView, labels, textfields] 之類的內容,并將約束作為 Top upperMost 視圖頂部空間添加到 contentView [就像我一樣]DoubleRight imageView

我的 DoubleRight imageView 的約束是

在給定頂部空間 20 點的情況下查找頂部空間邊距

同樣你需要為你將添加到 ContentView 中的最后一個項目做同樣的事情,就像我有 uiView 一樣

將各自視圖的底部空間添加到您的 superView[ContentView] 中,我的約束是:

在您初始化所有這些步驟后,每個屏幕尺寸的結果都將與預期一樣,無需額外更改屏幕尺寸的高度

注意:-[所有視圖必須通過 top 和 bottom 參數相互連接]

像 Flow 一樣

View1 - 頂部到 contentView,底部到 View2View2 - 從頂部到 View1,從底部到 view3View3 [Last view] - 頂部到 View2 和底部到 contentView,如圖所示

使用uiView,uiimageViews的高度必須是固定的

I'm using swift to build an application. I want to add some content to my view controller using storyboard.

I already put everything inside the scrollview and set the specific height, but however when I run the application, the scrollview always set longer than the button in the bottom of the view

I want the scroll view stop right after the button

Please kindly help me how to solve this problem

thank you

after scrolling

for your information, please ignore the white space between 'critics' and submit button, because actually there's UITextView between them but not visible (still try to add some border)

these are my storyboard preview

解決方案

1) ScrollView Contraints

2) ScrollView -> contentView Constraints to scroll View same as above image

3) now ContentView width and Height Constraints to main View [SuperView in which ScrollView is embedded] and constraints will be as follows.

4) now click on the EqualWidth to View [Third constraint from top]and edit it as in step 6

5) contentView Width Contraint

6) ContentView Height Constraint // set priority [must] . here you need to change the first item and second item in the menu to as shown First as - ContentView.Height and second as - View.height and set priority to 250 after this a dotted line will appear in storyboard along the contentView

7) now add the content like [UIView, labels, textfields] in contentView and add constraints as Top upperMost view top space to contentView [like I have]DoubleRight imageView

and constraints for my DoubleRight imageView are

look for the Top space margin its given a top space 20 points

and same you need to do for the last item you will be adding in ContentView like I have uiView

add bottom space from this respective view to your superView[ContentView] and my constraints are:

after you had initialed all these steps results will be as Expected for every Screen size no need to change height additionally for screen sizes

Note : - [all the views must be connected to each other with top and bottom parameter]

like Flow will be

View1 - top to contentView and bottom to View2
View2 - top to View1 and bottom to view3
View3 [Last view] - top to View2 and bottom to contentView as shown 

using uiView, uiimageViews their heights must be fixed

這篇關于如何在 Swift 中設置 UIScrollView 高度的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

相關文檔推薦

how to set scrollview content size in swift 3.0(如何在 swift 3.0 中設置滾動視圖內容大小)
Stop a UITableView from automatically scrolling(阻止 UITableView 自動滾動)
iOS UIScrollView Lazy Loading(iOS UIScrollView 延遲加載)
using iOS 6.0 SDK and building for iOS 5 Target causes UIScrollView setMinimumZoomScale to fail when running on iOS 5 simulator(在 iOS 5 模擬器上運行時,使用 iOS 6.0 SDK 并為 iOS 5 Target 構建會導致 UIScrollView setMinimumZ
Create partial-screen UIPageViewController programmatically(以編程方式創建部分屏幕 UIPageViewController)
how to make an ImageView zoomable with or without ScrollView.?(如何使用或不使用 ScrollView 使 ImageView 可縮放?)
主站蜘蛛池模板: 天天干天天操天天 | www.男人的天堂| 久久婷婷网 | 手机看片国产 | 高潮毛片无遮挡免费看 | 亚洲福利视频一区 | 黄色大毛片 | 青青国产在线 | 成人免费福利 | 久久99精品久久久久久国产越南 | 成人动漫在线看 | 亚洲欧美日韩国产 | 欧美色影院 | 欧美日韩免费 | 一区二区三区国产视频 | 久久久久久久九九九九 | 97免费在线| 成人aaa | 国产成人精品久久久 | 午夜国产一区 | 免费日韩av | 中文字幕有码在线 | 日韩在线视频免费 | 一级黄色av| 欧美黄视频 | 国产裸体永久免费视频网站 | 久久久久国产视频 | 天堂a在线 | 精品国产一区二区三 | 午夜视频一区二区三区 | 婷婷色在线 | 久久精品国产亚洲 | 国产女人水真多18毛片18精品 | 亚洲最大黄色网址 | 黄色片视频网站 | 一级黄色免费视频 | 三级在线播放 | 日本不卡视频在线观看 | av在线播放网站 | 国产成人精品亚洲 | 69精品视频|