SAMultisectorControl 允许您创建具有美观设计和圆形结构的多选控件。它允许用户轻松更改值。易于使用且具有高人体工程学水平。
代码
//colors for circles
UIColor *redColor = [UIColor colorWithRed:245.0/255.0 green:76.0/255.0 blue:76.0/255.0 alpha:1.0];
UIColor *blueColor = [UIColor colorWithRed:0.0 green:168.0/255.0 blue:255.0/255.0 alpha:1.0];
UIColor *greenColor = [UIColor colorWithRed:29.0/255.0 green:207.0/255.0 blue:0.0 alpha:1.0];
//creating setctors objects
SAMultisectorSector *sector1 = [SAMultisectorSector sectorWithColor:redColor maxValue:16.0];
SAMultisectorSector *sector2 = [SAMultisectorSector sectorWithColor:blueColor maxValue:8.0];
SAMultisectorSector *sector3 = [SAMultisectorSector sectorWithColor:greenColor maxValue:1000.0];
//setting tags
sector1.tag = 0;
sector2.tag = 1;
sector3.tag = 2;
//setting start and end values
sector1.endValue = 13.0;
sector2.endValue = 3.0;
sector3.startValue = 300.0;
sector3.endValue = 650.0;
//displaying sectors
[self.multisectorControl addSector:sector1];
[self.multisectorControl addSector:sector2];
[self.multisectorControl addSector:sector3];
iOS >= 6.0
我不拥有这个 UI 控件的设计。设计和概念来自 Dribbble
SAMultisectorControl 在 MIT 许可下提供。有关更多信息,请参阅 LICENSE 文件。
Jaroslav Khorishchenko
[email protected]