UISegmentedControl以编程方式更改段数 [英] UISegmentedControl change number of segments programmatically

查看:121
本文介绍了UISegmentedControl以编程方式更改段数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在名为SegmentedAnswer的视图中有一个UISegmentedControl,有四个段。
有没有办法以编程方式更改细分数量?
非常感谢!

I've a UISegmentedControl in a view called SegmentedAnswer, with four segments. Is there a way to change the number of segments programmatically? Thanks a lot!

推荐答案

是的,你可以使用

removeSegmentAtIndex:(NSUInteger) animated:(BOOL)

insertSegmentWithTitle:(NSString *) atIndex:(NSUInteger) animated:(BOOL)

这篇关于UISegmentedControl以编程方式更改段数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆