問題描述
我有一個垂直滾動的 uiscrollview - 想象一下標簽欄應用程序的關于此應用程序"頁面,它會運行一點并且需要滾動視圖.它只包含一些圖像、一個視頻和一些文本(只有視頻已被編碼 - 其余部分已放置在 GUI 中).在情節提要(界面生成器?)Xcode 4.2中,一切都按應有的方式設置并且工作正常,但是視圖僅與您在屏幕上看到的一樣大,是否無法在情節提要中手動排列項目最初在屏幕外 - 您需要向上滾動到?到目前為止,我發現的唯一方法是在可見視圖上設計它們,然后使用箭頭鍵向下導航.
I have a vertically scrolling uiscrollview - imagine an 'about this app' page of a tab bar app which goes on a bit and requires a scrollview. It only contains a few images, a video and some text (only the video has been coded in - the rest have been placed in the GUI). In storyboard (Interface Builder?) Xcode 4.2, everything is set up as it should be and works fine, but the view is only as large as what you see on the screen, is it not possible to manually arrange in storyboard the items that are initially offscreen - that you need to scroll up to? The only way I've found so far is to design them on the visible view then navigate them down with the arrow keys..
推薦答案
我感覺到你的痛苦.我發現的唯一方法是在尺寸檢查器中手動平移滾動視圖,以顯示您希望在視覺上編輯的視圖部分.
I feel your pain. The only way I found is to manually pan the scroll view in the size inspector to reveal the portion of the view that you wish to visually edit.
使用 UIView 來包含元素,以便它們相對于該視圖定位.將視圖作為子視圖添加到 0,0 處的滾動視圖.
Use a UIView to contain elements so they are positioned relatively to this view. Add the view as a subview to the scrollview at 0,0.
- 平移:使用 Y 坐標說 -200,然后編輯內容.
- 若要在隱藏部分放置更多內容,請再次平移以顯示新的不動產
- 完成后,恢復 ScrollView 的高度和 X、Y 位置的值.
確保滾動視圖框架矩形小于包含的視圖.
Make sure the scroll view frame rectangle is smaller than the contained view.
這篇關于使用故事板在 xcode 4.2 中設計滾動視圖的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!