【发布时间】:2011-05-10 10:09:36
【问题描述】:
我有四个子视图,当我在分段控件中选择 (segment ==1) 时,其他视图的 alpha 值必须为 0.00,只有 1 号子视图的 alpha 值必须为 1.00,我会显示我的代码:
if (segmentedContr.selectedSegmentIndex == 1) {
[subView1 setAlpha:0.0];
}
这很简单,但是我必须在哪里编写这段代码?在 IBAction 中?还是在通用方法(void)中?如果我这样做了
-(void)segmentAction:(id)sender
我必须在哪里调用这个方法?
【问题讨论】:
-
IBAction被预处理器翻译成void。
标签: objective-c cocoa-touch ios subview uisegmentedcontrol