我目前正在制作一个应用程序,其中 suer 选择MKMapView
注释,然后注释(pin)的标题detailtextLabel
在 Right Detail中设置为 a UITableViewCell
。我的问题是当文本很大时,detailTextLabel
变成多行。当这种情况发生时TextLabel
,单元格(左边的那个)向上移动。这是我试过的:
在 cellForRowAtIndexPath 方法中,我尝试通过以下代码调整框架:
CGRect frame = cell.textLabel.frame;
frame.origin.y = cell.frame.size.height/2;
cell.textLabel.frame = frame;
单元格在哪里
UITableViewCell
设置为正确的细节子类化单元格并尝试调整框架中的
-(void)layoutSubviews
如何阻止它上升并将其保持在单元格的中心?