如何在UITableView中创建2列

时间:2010-12-07 06:10:26

标签: iphone

如何在UITableView中创建两个列....

我找到了mac ..我需要为iphone创建....我找到了行....如何为我的UITableView获取两个列...对于我需要导航的每个人。

首先,我需要获得UITableView的两个列。

5 个答案:

答案 0 :(得分:2)

如果需要独立滚动,最好的办法是并排放置两个桌面视图。否则,如果需要同时滚动,则将单个单元格设计为两个单元格。

UIPickerView允许多列,但您可能不需要这种滚动界面。

答案 1 :(得分:0)

您可以通过自定义tableview单元格获得两列。只需使用自定义单元格并根据需要进行设计。使用tableview中的custome单元格,并设置表格标题,看起来非常好看。

答案 2 :(得分:0)

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

答案 3 :(得分:0)

答案 4 :(得分:0)

            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");

}

我在我的单元格中配置上面的代码......我的单元格上有一个按钮.....我按下了按钮所需的动作.....

感谢支持我查询的人。