1

プリセットのテキスト フォントと色がUIButtonあり、タップ ボタンをタップするとすぐに変更する必要があります。

私は試します:

- (IBAction)tapAction : (id)sender 
{
    // determine button from tag ..
   [crtBtn setTitleColor:self.selectedTextColor forState:UIControlStateSelected];
   [crtBtn setTitleColor:self.selectedTextColor forState:UIControlStateNormal];
   [crtBtn setTitleColor:self.selectedTextColor forState:UIControlStateApplication];
   [crtBtn setTitleColor:self.selectedTextColor forState:UIControlStateHighlighted];    
   [crtBtn setNeedsDisplay];
}

これを修正する方法はありますか?

4

3 に答える 3

2

このコードを試してください:

 - (IBAction)tapAction : (id)sender 
    {  
    [sender setTitleColor:self.selectedTextColor forState:UIControlStateNormal]
    }
于 2013-10-16T09:23:41.907 に答える
1

これは私のために働く:

-(IBAction)tapAction: (UIButton *)sender 

{

 [crtBtn setTitleColor:self.selectedTextColor forState:UIControlStateNormal];

}
于 2013-10-16T12:15:32.810 に答える