UISwitch控件修改大小。设置颜色

// 显示的颜色
   
_switch0 . onTintColor = [ UIColor colorWithRed : 0.984 green : 0.478 blue : 0.224 alpha : 1.000 ];
   
// 控件大小,不能设置 frame ,只能用缩放比例
   
_switch0 . transform = CGAffineTransformMakeScale ( 0.75 , 0.75 );
   
// 控件开关
   
if ([ _allowSearch intValue ]== 0 ){
       
_switch0 . on = NO ;
   }
else {
       
_switch0 . on = YES ;
   }

你可能感兴趣的:(UISwitch控件修改大小。设置颜色)