开发者

how can i write an event for segment controller?

i want to write an event for the segment controller.By clicking First Tab i want to perform some calcul开发者_如何学编程ation and by clicking Second Tab i want to perform some different operation.please help me.


Create an IBAction

-(IBAction)segCtrlValueChanged:(UISegmentControl*)segCtrl;

and then link the "Value Changed" event to this action in Interface Builder, or programmatically, call

[segmentationControl addTarget:foo action:@selector(segCtrlValueChanged:)
              forControlEvents:UIControlEventValueChanged];

If the IBAction, check segCtrl.selectedSegmentIndex to see which item is active.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜