我为我的通用应用程序制作了自定义单元格。在iPhone屏幕文本是正常的,但当我移动到iPad屏幕文本从最左边开始(如下图所示)。我怎么能把它移动一点(也许10px)。有没有办法从012px 方法中的10px开始文本标签?提前致谢。UITableViewCell中的文本对齐
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell2";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
cell.textLabel.text = [firstArray objectAtIndex:indexPath.row];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.textLabel.numberOfLines = 0;
[cell.textLabel setLineBreakMode:NSLineBreakByWordWrapping];
UIImage *background = [self cellBackgroundForRowAtIndexPath:indexPath];
cell.separatorInset = UIEdgeInsetsMake(0, 0, 0, cell.bounds.size.width);
UIImageView *cellBackgroundView = [[UIImageView alloc] initWithImage:background];
cellBackgroundView.image = background;
cell.backgroundView = cellBackgroundView;
return cell;
}
你怎么现在设置你的细胞?发布一些如何创建自定义单元格的代码 – Stonz2