本文介紹了在 Xcode 6 中通過 Storyboard 設置 UITableView 的 contentInset的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
在 Xcode 6 上,似乎已經取消了通過 UIStoryboard 設置滾動視圖/表格視圖的內容插入的功能.見下圖:
On Xcode 6, it seems that the ability to set the content inset of a scroll view/table view through UIStoryboard has been taken away. See image below:
左邊的參數來自 Xcode 6,右邊的參數來自 Xcode 5
the parameters on the left are from Xcode 6, whereas the parameters on the right are from Xcode 5
有誰知道參數是否已經移動,或者我們不再能夠通過 UIStoryboard 設置內容插圖?如果可能的話,我真的很想把它排除在我的代碼之外..
Does anyone know if the parameters have moved, or are we no longer able to set the content inset through UIStoryboard? I'd really like to keep this out of my code if possible..
推薦答案
你可以通過使用 KVC 來做到這一點
You can do that by using KVC
- 選擇表格視圖
- 選擇身份檢查員
- 在用戶定義的運行時屬性"中按+"
- 將您的插圖添加為 Rect {{10,15},{25,10}} 用于 KeyPath contentInset
- Select table view
- Choose Identity Inspector
- Press "+" in "User defined runtime attributes"
- Add your inset as a Rect {{10,15},{25,10}} for KeyPath contentInset
截圖在這里:
這篇關于在 Xcode 6 中通過 Storyboard 設置 UITableView 的 contentInset的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!