swift-自定义SegmentControl

时间:2022-09-03 20:30:22
【文件属性】:
文件名称:swift-自定义SegmentControl
文件大小:61KB
文件格式:ZIP
更新时间:2022-09-03 20:30:22
Swift开发-UI相关控件 iOS提供的控件UISegmentControl可以通过setBackgroundImage、setDividerImage等改变控件的外观。但在处理圆角和按下状态时效果不太理想,所以实现了一个自定义控件,它继承UIButton,使用方法和系统UISegmentControl类似,支持点击和拖动。
【文件预览】:
SegmentDemo-master
----CustomSegmentControlSample.png(19KB)
----SegmentDemo.xcodeproj()
--------project.xcworkspace()
--------xcuserdata()
--------project.pbxproj(14KB)
----SegmentDemo()
--------ViewController.m(2KB)
--------Info.plist(1KB)
--------mySegCtrl-selected-bkgd@2x.png(2KB)
--------mySegCtrl-normal-bkgd@2x.png(2KB)
--------main.m(334B)
--------CustomSegmentControl.m(8KB)
--------mySegCtrl-selected-bkgd@3x.png(4KB)
--------Base.lproj()
--------ViewController.h(215B)
--------AppDelegate.h(277B)
--------mySegCtrl-normal-bkgd@3x.png(3KB)
--------Assets.xcassets()
--------CustomSegmentControl.h(715B)
--------AppDelegate.m(2KB)
----README.md(2KB)

网友评论