点击tableview中的textField为什么没有出发 didSelectRowAtIndexPath事件?点击textField外面的地方就可以触发,为什么呢?如何让点击tableview中的textField触发didSelectRowAtIndexPath事件?
解决方案 »
- 想做一个应用图标隐藏的软件,像腾讯手机管家Pro里的软件隐藏
- javapns 推送服务
- 请问怎么在UITextFeild中插入所选表情对应的字符串到当前光标处?
- IOS越狱开发Hello World
- 论坛里有从C++转行过来的吗?
- ios服务器如何搭建
- 最近在研究ipad展示型的项目,遇到了一个关于一个UIScrollView装载viewcontroller,一个UIScrollView当导航的效果,希望帮下忙
- iPhone6 plus 的尺寸 和 分辨率 问题
- [NSThread isMainThread]返回值可靠吗
- IOS 震动,如何控制时常
- 跪求一份社区客户端的产品设计方案,和 服务器源码(最好能有微博功能)
- 新手关于xcode4.2
// Called before the user changes the selection. Return a new indexPath, or nil, to change the proposed selection.
- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath;
- (NSIndexPath *)tableView:(UITableView *)tableView willDeselectRowAtIndexPath:(NSIndexPath *)indexPath
查看⋯⋯
{
//获取第几分区
NSUInteger section = [indexPath section];
//获取行
NSUInteger row=[indexPath row];
static NSString *simpleTableIdentifier=@"SimpleTableIdentifier";
UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
if(cell==nil){
cell=[[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:simpleTableIdentifier] autorelease];
}
UITextField *txtField2=[[UITextField alloc] initWithFrame:CGRectMake(10, 2, 580, 40)];
//NSLog(@"[tableData objectAtIndex:row]:%@",[tableData objectAtIndex:row]);
txtField2.text=[listData objectAtIndex:row];
txtField2.delegate=self;
txtField2.tag=row+10;
//txtField.backgroundColor=[UIColor redColor];
txtField2.font=[UIFont fontWithName:@"Arial" size:28];
//[txtField scrollRectToVisible:CGRectMake(0, txtField.contentSize.height-15, txtField.contentSize.width, 10) animated:YES];
[txtField2 addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
[cell.contentView addSubview:txtField2];
[txtField2 release];
//cell.textLabel.text=[listData objectAtIndex:row];
//cell.textLabel.font=[UIFont boldSystemFontOfSize:15];
return cell;
}
txtField2.userInteractionEnabled = NO;回去试试
这般处理后就好了⋯⋯
还可以用页面切换、touch事件中触发cell选中 等思路⋯⋯
不过,解决就好了,呵呵
我一直奔着这个思路去的