UIButton 子类:HGWActivityButton
jopen
10年前
一个UIButton子类使用自定义,内置活动指示灯。
采用Swift开发
用法
var activityButton = HGWActivityButton(frame: CGRectMake(115, 80, 90, 90)) activityButton.backgroundColor = UIColor.orangeColor() activityButton.setTitle("Load", forState: UIControlState.Normal) activityButton.activityTitle = "Loading" activityButton.rotatorColor = UIColor.darkGrayColor() activityButton.rotatorSize = 8.0 activityButton.rotatorSpeed = 10.0 activityButton.rotatorPadding = 8.0 self.view.addSubview(activityButton)