【发布时间】:2012-06-08 14:48:59
【问题描述】:
我在 UISegmentedView 的一个 UISegments 中放置了一个自定义 UIButton,但不知何故,这个按钮没有被按下。 我使用以下代码:
UIButton* button=[UIButton buttonWithType:UIButtonTypeCustom];
button.frame=CGRectMake(0, 0, 103, 30);
[button addTarget:self action:@selector(handleSaleChange:) forControlEvents:UIControlEventAllTouchEvents];
button.backgroundColor=[UIColor redColor];
[[[self.segmentControl subviews]objectAtIndex:2] addSubview:button];
[self.segmentControl bringSubviewToFront:button];
知道为什么我会遇到这个问题吗? 谢谢!
【问题讨论】:
标签: iphone ios cocoa-touch cocoa uisegmentedcontrol