IOS的UISegmentedControl效果图如下:
UISegmentedControl的声明如下:
UISegmentedControl的常用属性:
为了监听UISegmentedControl各段的点击事件,需要给UISegmentedControl设置UIControlEvents.ValueChanged事件:
最后将UISegmentedControl的对象添加到UIViewController中:
IOS的UISegmentedControl效果图如下:
UISegmentedControl的声明如下:
UISegmentedControl的常用属性:
为了监听UISegmentedControl各段的点击事件,需要给UISegmentedControl设置UIControlEvents.ValueChanged事件:
最后将UISegmentedControl的对象添加到UIViewController中: