use*_*857 17 iphone cocoa-touch uitableview ios
我已经创建了一个UITableView并希望UITableViewCell在加载视图时显示选中(蓝色)的特定内容.
Haf*_*hor 41
-(void)viewWillAppear:(BOOL)animated {
// assuming you had the table view wired to IBOutlet myTableView
// and that you wanted to select the first item in the first section
[myTableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]
animated:NO
scrollPosition:UITableViewScrollPositionTop];
}
Run Code Online (Sandbox Code Playgroud)
我正在使用这种技术来选择两个中的一个,UITableViewCells以便用户知道UIDatePicker它将影响表格视图下方的哪个单元格.当您创建新事件并设置日期时,Apple会在日历应用中使用此技术.
使用 UITableViewCell 方法
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
Run Code Online (Sandbox Code Playgroud)
信息在这里。
| 归档时间: |
|
| 查看次数: |
26174 次 |
| 最近记录: |