【发布时间】:2011-12-02 20:40:43
【问题描述】:
我将 UILabel 添加到简单的 UITableViewCell,但是当我将设备旋转到横向时,UILabel 不会移动到右侧,即使 myLabel.autoresizingMask = UIViewAutoResizingFlexibleRightMargin; 它位于 UITableViewCell 的中间。
在纵向模式下,myLabel 位于 UITableViewCell 的右侧。这是代码:
myLabel = [[UILabel alloc] initWithFrame:CGRectMake(252, 12, 60, 20)];
myLabel.font = [UIFont fontWithName:@"Helvetica" size:11];
myLabel.textColor = tableViewCell.detailTextLabel.textColor;
myLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
myLabel.highlightedTextColor = [UIColor whiteColor];
myLabel.text = video.duration;
myLabel.tag = 999;
[cell.contentView addSubview:durationLabel];
[myLabel release];
当我将设备旋转到横向模式时,如何将此 UILabel 移动到单元格的右侧?
【问题讨论】:
标签: iphone objective-c ios uiview uilabel