iOS Developer

iOS 自定义UISwitch OC Swift

2016-07-31  本文已影响113人  屈涯

//OC版

-(void)awakeFromNib{

[superawakeFromNib];

self.transform=CGAffineTransformMakeScale(0.5,0.5);

self.layer.anchorPoint=CGPointMake(0,0.5);

}

//Swift版

classSwitchButton:UISwitch{

overridefuncawakeFromNib() {

transform=CGAffineTransformMakeScale(0.5,0.5)

layer.anchorPoint=CGPoint(x:0, y:0.3)

}}

上一篇下一篇

猜你喜欢

热点阅读