2011-04-12 66 views

回答

1

相反单选按钮,你可以使用一个:

  • 专用行

    • UISegmentedControl在UITableVie对于选择
    • 推出自己的

    为了快速在网上的东西,使用UISegmentedControl读写控制,当这更是一个新的环境,或者有太多的选择,使用嵌套的UITableView控制你从你的UINavigationController中推送,如果只有少数选项,你可以将UITableView中的几行放到radio选项中并自己运行。 MonoTouch.Dialog(我自己的外部库)提供了一种创建UITableView控制器的简单方法,特别是类似于使用UITableView解决方案创建的类似于射频按钮的功能。

    对于复选框,您可以在UITableView单元上使用装饰,也可以使用滑块控件进行“开/关”设置。

    同样,如果你使用UItableView方法,MonoTouch.Dialog会为你做大部分工作。

    下载的代码和样本:

    http://github.com/migueldeicaza/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朋友

    +0

    如果这有助于请upvote.Your给予好评壮大实力继续发布我们的答案 – 2011-04-12 12:53:22

    +0

    如何,我们可以用MonoTouch的实现? – bharath 2011-04-12 12:58:33

    +0

    plz解释一个小朋友。你可以使用触摸移动并开始 – 2011-04-12 13:01:57

    相关问题