你好我已經創建了動態按鈕,在我的靜態的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