我正在处理待办事项列表应用程序。但是,我似乎无法正确地将我的复选框图像与cell.textLabel.text对齐。UITableViewCell文本对齐和子视图重叠
我对下面的代码问题的话“考试考试”通过我的复选框图像,只留下了“t检验”了盖
我的复选框按钮图像像
UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(5.0, 7.0, 25.0, 25.0)];
UIImage *uncheckedButtonImage = [UIImage imageNamed:@"unchecked_checkbox.png"];
[button setImage:uncheckedButtonImage forState:UIControlStateNormal];
[cell.contentView addSubview:button];
代码
和我的手机为textLabel只是
cell.textLabel.text = @"test test";
反正是有对齐的为textLabel文字有点向右移动?
为什么不使用UILabel作为视图并将其添加到单元格,您将拥有更多的控制权。 – 2011-04-06 14:53:57