我现在在一个应用程序上工作我需要一些标签在桌面视图单元格上,当用户点击该标签上,然后键盘会显示我们如何做,可以有人告诉我。我搜查,但他们使用通知我不想要的每个地方。如何显示键盘出现在标签触摸在桌面视图(iphone)
感谢
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:
(NSIndexPath*)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView
dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc]
initWithStyle:UITableViewCellStyleValue1
reuseIdentifier:CellIdentifier]
autorelease];
}
cell.textLabel.text=[Players objectAtIndex:indexPath.row];
playername=[[UITextField alloc]initWithFrame:CGRectMake(10, 5, 100, 30)];
[email protected]"Player";
playername.delegate=self;
playername.keyboardType=UIKeyboardTypeDefault;
playername.returnKeyType=UIReturnKeyDone;
[cell.contentView addSubview:playername];
cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
return cell;
}
所以你的物品在你的tableview单元格是一个可编辑的UITextField,而不是一个不可编辑的UILabel,* right *? – 2012-04-19 06:31:49
是的michael你说得对,标签是可编辑的。 – vishiphone 2012-04-19 06:47:54
@vishiphone:如果这个_label_是可编辑的,那么它是一个UITextField而不是UILabel? – 2012-04-19 08:03:20