【发布时间】:2014-07-02 23:39:23
【问题描述】:
我正在尝试将以下控件添加到视图控制器内的 UIView。该控件似乎没有出现在视图内。
https://www.cocoacontrols.com/controls/dznsegmentedcontrol
NSArray *items = @[@"Kicks", @"Re-kicks", @"Interested"];
DZNSegmentedControl *control = [[DZNSegmentedControl alloc] initWithItems:items];
control.tintColor = [UIColor blueColor];
control.delegate = self;
control.selectedSegmentIndex = 2;
[control addTarget:self action:@selector(selectedSegment:) forControlEvents:UIControlEventValueChanged];
[cell.segmentView addSubview:control];
【问题讨论】:
-
“它似乎不起作用”不是一个问题。请说出您的期望和实际发生的情况。
标签: ios objective-c uiview uisegmentedcontrol