我想,因为它包含在其右侧的图像以限制的UITabelViewCell
textLabel
宽度。如何限制为textLabel的宽度UITabelViewCell
我不想使用UILabel
或子类UITabelViewCell
。
我想,因为它包含在其右侧的图像以限制的UITabelViewCell
textLabel
宽度。如何限制为textLabel的宽度UITabelViewCell
我不想使用UILabel
或子类UITabelViewCell
。
尝试使用accessoryView
属性右边的图像。这应该防止标签变得太宽并截断文本。
[cell setAccessoryView:<your image view>];
cell.textLabel.numberOfLines = 3; // set the numberOfLines
cell.textLabel.lineBreakMode = UILineBreakModeTailTruncation;
OR
CGRect aFrame = cell.textLabel.frame;
aFrame.size.width = 100; // for example
cell.textLabel.frame = aFrame;
没有,什么都没有发生。 – astuter
那么你的textLabel.frame包含哪些内容? –
http://stackoverflow.com/questions/12085174/set-width-of-uitableviewcell-text – IronManGill