UITextField - 堆叠

时间:2011-10-04 21:30:25

标签: iphone objective-c interface-builder

如何创建“堆叠的”UITextFields,如附图所示?

enter image description here

2 个答案:

答案 0 :(得分:6)

看起来像UITableView,样式设置为“Grouped”

答案 1 :(得分:0)

- (UITableViewCell *)tableView:(UITableView *)tableView
     cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
  UITextField *myTxtField = [[UITextField alloc]init];
  [TxtUserID setFont:[UIFont fontWithName:@"Verdana" size:15]];
  [TxtUserID setFrame:CGRectMake(50, 100, 20, 10)];
  [TxtUserID setBorderStyle:UITextBorderStyleRoundedRect];
  [cell addSubview:myTxtField];
  cell.accessoryView = myTxtField;
}

Hope this will help you out