如何在UITableView的

如何在UITableView的

问题描述:

创建2列如何创建UITableView的两个列的....如何在UITableView的

我发现的Mac。我需要为iphone ....我发现行....如何为我的UITableView获取两列...对于我需要导航的每个人。

首先,我需要为UITableView获取两列。

+0

嗨.. Joe Blow ....感谢您的重播......但我的单元格需要执行两列的detailedTextLabel并且有n行的行数...第一列将加载另一个nib文件...第二行将加载另一个笔尖..文件。 – 2010-12-10 09:54:41

+0

UIButton * button = [UIButton buttonWithType:UIButtonTypeCustom]; \t \t \t button.frame = CGRectMake(60,0,50,25); //按钮的大小和位置 \t \t \t [button setTitle:@“More this date”forState:UIControlStateNormal]; \t \t \t [button setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; \t \t \t [button setFont:[UIFont systemFontOfSize:8]]; \t \t \t [button addTarget:self action:@selector(action :) forControlEvents:UIControlEventTouchUpInside]; \t \t \t [cell.contentView addSubview:button]; – 2010-12-10 11:28:31

最好的办法是并排放置两个表格视图,如果他们需要单独滚动。否则,设计一个单元格看起来像两个单元格,如果他们需要一致滚动。

UIPickerView允许多列,但您可能不想要那种风格的滚动界面。

+0

.. Yeap ..我会尝试自定义我的UITableView单元..我可能会将一个单元分成两部分。细胞....我需要保持每个细胞不同的行动。 – 2010-12-10 09:17:03

您可以通过自定义tableview单元格来获得两列。只需使用自定义单元格并根据需要进行设计即可。在你的tableview中使用custome单元格,并且还可以设计表头,以获得相当好的外观。

根据所需的可滚动视图的功能和大小,还可以考虑使用UIScrollView并手动绘制列。也许最好的,如果你正在寻找像电子表格一样的经验。

  UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];  
      button.frame = CGRectMake(60, 0, 50, 25); // size and position of button 
      [button setTitle:@"More this date " forState:UIControlStateNormal]; 
      [button setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; 
      [button setFont:[UIFont systemFontOfSize:8]]; 
      [button addTarget:self action:@selector(action:) forControlEvents:UIControlEventTouchUpInside]; 
      [cell.contentView addSubview:button]; 



-(IBAction)action:(id)sender{ 

    NSLog(@"More on this date"); 

} 

I-配置我的手机上面的代码......我得到我的手机按钮.....和我做了我该按钮必要的行动...... ..

感谢支持我的查询的人。