我使用Interface Builder和UI组件进行了检查。但是没有RadioButton和CheckBox。有没有其他的方式来添加这些组件?我使用MonoTouch开发iPhone应用程序。如何使用MonoTouch在iPhone上添加RadioButton和CheckBox?
0
A
回答
1
相反单选按钮,你可以使用一个:
- UISegmentedControl在UITableVie对于选择
- 推出自己的
为了快速在网上的东西,使用UISegmentedControl读写控制,当这更是一个新的环境,或者有太多的选择,使用嵌套的UITableView控制你从你的UINavigationController中推送,如果只有少数选项,你可以将UITableView中的几行放到radio选项中并自己运行。 MonoTouch.Dialog(我自己的外部库)提供了一种创建UITableView控制器的简单方法,特别是类似于使用UITableView解决方案创建的类似于射频按钮的功能。
对于复选框,您可以在UITableView单元上使用装饰,也可以使用滑块控件进行“开/关”设置。
同样,如果你使用UItableView方法,MonoTouch.Dialog会为你做大部分工作。
下载的代码和样本:
1
是朋友为此,你必须添加一个图像 在.h文件中
int editCount;
int check;
in viewdidload{
editCount = 0;
check = 0;
}
if(check == 0)
{
UIButton *selectedButton = (UIButton *)sender;
if (editCount%2 == 0) {
[(UIButton *)[self.view viewWithTag:160] setImage:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"TICKIMAGE",[selectedButton tag]] ofType:@"png"]] forState:UIControlStateNormal];
}
else {
[(UIButton *)[self.view viewWithTag:160] setImage:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"PLAINBUTTON",[selectedButton tag]] ofType:@"png"]] forState:UIControlStateNormal];
}
editcount++;
}
这项工作类似于单选按钮u必须使用tickimage和plainbutton图像有..ok朋友
相关问题
- 1. 如何在DataGridView中添加radioButton&CheckBox?在C#中.net
- 2. 如何在QTreeView + QFileSystemModel上添加CheckBox
- 3. CheckBox和RadioButton不可见
- 4. Silverlight Conditional CheckBox/RadioButton
- 5. RadioButton-CheckBox组合
- 6. 如何在playframework中预选radiobutton-/checkbox-group?
- 7. Android - RadioButton和CheckBox在同一个ListView项
- 8. 如何使用MonoTouch在UIKeyboard上添加UIToolbar?
- 9. CheckBox和RadioButton控制适配器
- 10. 如何在Office 2016中添加CheckBox - Word?
- 11. 如何在GridView中添加CheckBox字段?
- 12. ASP.Net RadioButton控件继承CheckBox
- 13. 如何使用MonoTouch在iPhone上播放视频?
- 14. 如何使用MonoTouch在iPhone上播放声音?
- 15. 如何在iPhone上添加全屏iAd?
- 16. iPhone:如何在UITableView上添加UILabel?
- 17. 动态添加时如何检查RadioButton?
- 18. 如何将CheckBox添加到工具栏?
- 19. 如何在iPhone/iPad上使用核心图添加Z轴BarGraph
- 20. 在iPhone中使用相机时如何添加按钮“上传”?
- 21. 如何使用MonoTouch获取iPhone/iPad的宽度和高度?
- 22. RadioButton和Checkbox是否有任何键盘快捷键?
- 23. 如何使用MonoDevelop和MonoTouch在设备上进行调试?
- 24. 如何使用CheckBox和Image制作ListView?
- 25. MonoTouch的:如何添加的UITabBarController
- 26. 如何添加在iphone
- 27. 从CheckBox或RadioButton获取isChecked()值
- 28. 在Monotouch中使用iPhone游戏中心
- 29. 使用Monotouch在iPhone中播放MJPEG流
- 30. 如何使用MonoTouch为iPhone应用程序使用多语言?
如果这有助于请upvote.Your给予好评壮大实力继续发布我们的答案 – 2011-04-12 12:53:22
如何,我们可以用MonoTouch的实现? – bharath 2011-04-12 12:58:33
plz解释一个小朋友。你可以使用触摸移动并开始 – 2011-04-12 13:01:57