热门搜索 :
考研考公
您的当前位置:首页正文

iOS-多个UIButton放大效果的转移

来源:东饰资讯网

多个UIButton并列排放时,经常会用到Button点击后文字放大的情况。

- (void)dealButton:(UIButton *)button
{
    for(int i =0;i < 8; i++)
    {
        UIButton *button1 = [UIButton buttonWithType:UIButtonTypeCustom];
        button1 = _arrayM[i];
        NSLog(@"%@",_arrayM[i]);
        if(button.tag == i)
        {
            button1.titleLabel.font = [UIFont systemFontOfSize:21];
            [button1 setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal];
        }
        else
        {
            button1.titleLabel.font = [UIFont systemFontOfSize:19];
            [button1 setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        }
            
    }
}
Top