0
我的應用程序包含一個UITableViewController
。默認縮進(編輯時)很好,除了在橫向模式下的iPad上,縮進太寬時。我已經嘗試在cellForRowAtIndexPath
中設置indentationWidth
和indentationLevel
,但似乎沒有任何效果。UITableViewCell自定義縮進寬度
,我想我的代碼工作是這樣的:
override func tableView(tableView: UITableView,
cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
{
let cell = tableView.dequeueReusableCellWithIdentifier("Cell",
forIndexPath: indexPath)
// do other cell configuration here
if UIDevice.currentDevice().userInterfaceIdiom == .Pad {
// set the custom indentation level for the cell here
// Tried:
// cell.indentationWidth = 0.1
// cell.indentationLevel = 0
// both have absolutely no effect
}
}
景觀iPad上可怕的縮進: 同樣的細胞,而不是編輯: 在此先感謝您的幫助。
有些圖片會對理解很有幫助。 – liushuaikobe
@liushuaikobe感謝您的建議。爲了清晰起見,我添加了一些截圖。 –
顯示您設置縮進級別的代碼。 – Mundi