ios7中的UITableViewCell现在左右有差距 [英] UITableViewCell in ios7 now has gaps on left and right
问题描述
我有一个UITableView,在ios6中,我的自定义单元格完全伸展到屏幕的左右两侧。所以我在手机屏幕左侧的方形图像很难对付手机屏幕。
I have a UITableView where, in ios6, my custom cell stretched completely to the left and right sides of the screen. So my square image on the left of the cell was hard up against the phone screen.
然而,现在在ios7中,左侧出现了一个小间隙所以图像现在远离侧面并且在单元格中略微重叠我的文本。
However, now in ios7, there is a small gap appearing on the left hand side so the image is now away from the side and slightly overlaps my text within the cell.
这似乎也发生在我现在正在查看的其他应用程序中ios7 - 左边和右边都有间隙。
This also seems to be happening in other apps I have that I am now viewing in ios7 - all have a gap on the left and perhaps the right as well.
根据Interface Builder,我的自定义单元格设置为320 - ios 7没有变化这有吗?
My Custom cell is set to a size of 320 according to Interface Builder - ios 7 hasnt changed this has it?
推荐答案
将图像添加到 cell.contentView
解决了这个问题:
Adding the image to the cell.contentView
fixes the problem:
[cell.contentView addSubview:imgView];
这样你甚至不必介意 separatorInset
属性。
This way you don't even have to mind the separatorInset
property.
这篇关于ios7中的UITableViewCell现在左右有差距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!