UITableView 第一行被截断 [英] UITableView first row is cut off

查看:30
本文介绍了UITableView 第一行被截断的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么会导致导航控制器中表格的第一行被放置在导航控制器之下?

What would cause the first row of a table in a nav controller to be positioned so part of it is under the nav controller?

我似乎无法让它从上到下显示整行;它可能看起来很小,但它显然不正确,而且我觉得它没有吸引力.

I cannot seem to get it to show the whole row top to bottom; It may seem minor, but it's clearly not correct and I find it unattractive.

TableViewController 完全在代码中添加到导航控制器:

TableViewController added to nav controller entirely in code:

     SettingsRootController*settings=[[SettingsRootController alloc] initWithStyle:UITableViewStylePlain];
    self.settingsView=[[[UINavigationController alloc] initWithRootViewController:settings]autorelease];
    [settings release];

SettingsRootController 是 UITableViewController 的子类.

SettingsRootController is a subclass of UITableViewController.

推荐答案

似乎唯一可行的方法是手动将导航控制器内的表格视图向下移动 10 个像素,但仅适用于 iPhone,不适用于 iPad,因为有在 iPad 上没有对齐问题,在 iPad 上移动 10 个像素会产生间隙.这显然是某种导航控制器错误,因为在其他线程中还发现了其他奇怪的问题.

the only thing that seems to work is manually shifting the table view inside the nav controller down by 10 pixels, but only on iPhone, not on iPad, since there is no alignment problem on iPad and shifting by 10 pixels on iPad creates a gap. this is clearly some sort of nav controller bug, as there are other weird issues noted in other threads.

 CGPoint tableorigin=CGPointMake(0,ISIPAD?0:10);

这篇关于UITableView 第一行被截断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆