我添加一个tableviewCell在我的笔尖,即时通讯添加一个UIButton在一个单元格。问题是IBAction的按钮没有得到fired.im能够点击按钮可以你们帮助out.will如此感激按钮事件没有被解雇tableviewCell
0
A
回答
1
另一种方式来做到这一点...创建一个UIButton并将其添加到细胞在任何你需要它
内- (UITableViewCell的*)的tableView:(UITableView的*) tableView cellForRowAtIndexPath :(NSIndexPath *)indexPath使用开关检查表格行
switch (indexPath.row)
如果情况匹配,那么使用这个
UIButton *yourButton=[UIButton buttonWithType:UIButtonTypeRoundedRect];
[yourButton addTarget:self action:@selector(your_method_to_handle_button_clicked) forControlEvents:UIControlEventTouchUpInside];
yourButton.frame=CGRectMake(<#CGFloat x#>, <#CGFloat y#>, <#CGFloat width#>, <#CGFloat height#>);
[cell addSubview:yourButton];
+0
里面的表添加一个按钮的视图工作正常..其中一些复杂的地方在tableview.im里面添加一个tableview单元格放置butto的位置 – user578386
+0
你可以在button.frame = cgrectmake()中定义按钮位置..... – Neo
相关问题
- 1. 事件没有被解雇
- 2. 事件没有被解雇
- 3. Backbone.js事件没有被解雇
- 4. ComboBox.SourceUpdated事件没有被解雇
- 5. 页面事件没有被解雇
- 6. JavaScript事件没有被解雇
- 7. Silverlight事件MouseLeftButtonDown没有被解雇
- 8. Bootstrap模式事件没有被解雇
- 9. 事件并没有被解雇
- 10. Fancybox事件没有解雇
- 11. MVC ReactJS按钮onclick事件不会被解雇
- 12. 按钮服务器OnClick事件未在Firefox中被解雇
- 13. 哪个事件被解雇?
- 14. 事件不被解雇
- 15. KeyDown事件不被解雇
- 16. process.existed()没有被解雇
- 17. Redux Action没有被解雇
- 18. ImageButton OnClickListener没有被解雇
- 19. HTTP GET没有被解雇
- 20. Dialog没有被解雇
- 21. MouseLeftButtonDown没有被解雇
- 22. MFMailComposeViewController没有被解雇
- 23. UIAlertController没有被解雇
- 24. viewWillAppear没有被解雇
- 25. jquery悬停事件没有解雇?
- 26. Youtube视频事件没有解雇
- 27. keydown事件没有解雇,为什么?
- 28. 骨干关系事件没有解雇?
- 29. jquery灯箱事件没有解雇
- 30. Esc键盘事件没有在winforms中被解雇
你右击你的fileOwner对象在笔尖链接IBAction为给UIButton的? – SayeedHussain
yup它完成得很完美..像这样在tableView里面..i m添加tableview单元格放置按钮 – user578386
你是通过nib添加UITableViewCell和UIButton吗? – SayeedHussain