你好我已经创建了动态按钮,在我的静态的TableView这样如何添加微调指数在编程创建按钮
override func tableView(tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
let footerView = UIView(frame: CGRectMake(0, 0, tableView.frame.size.width, tableView.frame.size.height))
let button = UIButton(type: UIButtonType.System) as UIButton
button.frame = CGRectMake(0, 0, 414, 65)
button.setTitle(buttonTitle, forState: UIControlState.Normal)
button.addTarget(self, action:buttonAction, forControlEvents: UIControlEvents.TouchUpInside)
button.setTitleColor(UIColor.whiteColor(), forState:UIControlState.Normal)
button.titleLabel?.font = UIFont(name: Variables.MONTESERRAT_REGULAR, size: 20.0)
button.backgroundColor = UIColor().blueColor() //top
footerView.addSubview(button!)
return footerView
}
我想在按钮的顶部显示微调它的点击时。我知道如何使点击功能或如何创建一个微调。我只是不知道如何将旋钮放在按钮顶部以代替标题,以便当用户单击按钮时,标题隐藏和微调控件在标题位置移动。我希望你明白我的意思
将微调器添加为按钮的子视图。设置微调中心为button.center和: [button addSubview:yourspinner]; – 2016-03-04 13:26:59