問(wèn)題描述
我有一個(gè)垂直滾動(dòng)的 uiscrollview - 想象一下標(biāo)簽欄應(yīng)用程序的關(guān)于此應(yīng)用程序"頁(yè)面,它會(huì)運(yùn)行一點(diǎn)并且需要滾動(dòng)視圖.它只包含一些圖像、一個(gè)視頻和一些文本(只有視頻已被編碼 - 其余部分已放置在 GUI 中).在情節(jié)提要(界面生成器?)Xcode 4.2中,一切都按應(yīng)有的方式設(shè)置并且工作正常,但是視圖僅與您在屏幕上看到的一樣大,是否無(wú)法在情節(jié)提要中手動(dòng)排列項(xiàng)目最初在屏幕外 - 您需要向上滾動(dòng)到?到目前為止,我發(fā)現(xiàn)的唯一方法是在可見(jiàn)視圖上設(shè)計(jì)它們,然后使用箭頭鍵向下導(dǎo)航.
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..
推薦答案
我感覺(jué)到你的痛苦.我發(fā)現(xiàn)的唯一方法是在尺寸檢查器中手動(dòng)平移滾動(dòng)視圖,以顯示您希望在視覺(jué)上編輯的視圖部分.
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 來(lái)包含元素,以便它們相對(duì)于該視圖定位.將視圖作為子視圖添加到 0,0 處的滾動(dòng)視圖.
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 坐標(biāo)說(shuō) -200,然后編輯內(nèi)容.
- 若要在隱藏部分放置更多內(nèi)容,請(qǐng)?jiān)俅纹揭埔燥@示新的不動(dòng)產(chǎn)
- 完成后,恢復(fù) ScrollView 的高度和 X、Y 位置的值.
確保滾動(dòng)視圖框架矩形小于包含的視圖.
Make sure the scroll view frame rectangle is smaller than the contained view.
這篇關(guān)于使用故事板在 xcode 4.2 中設(shè)計(jì)滾動(dòng)視圖的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!