let phoneBtn:UIButton=UIButton.init(frame:CGRect(x:0,y:0,width:WIDTH,height:50))
setTitle("客服热线:4000-010-313", for:UIControlState.normal)
setTitleColor(UIColor.init(red:59.0/255, green:122.0/255, blue:246.0/255, alpha:1), for: UIControlState.normal)
setImage(UIImage.init(named:"bottomPhone"), for:UIControlState.normal)
imageEdgeInsets=UIEdgeInsets(top:0, left: -20, bottom:0, right: 0)
titleEdgeInsets=UIEdgeInsets(top:0, left: 0, bottom:0, right: 0)
tab.tableFooterView=phoneBtn
addTarget(self, action:#selector(phoneCall), for:UIControlEvents.touchUpInside)
       
//上啦刷新
       
        
    }
@objc func
print("打电话")
    }


==============按钮的封装,拿来即用======
 //开始按钮
let rect:CGRect=CGRect.init(x: 10, y: 200, width: 50, height: 50)
let font:UIFont=UIFont.systemFont(ofSize: 15)
let color:UIColor=UIColor.red
let bgcolor:UIColor=UIColor.white
let acs:Selector=#selector(ac)//事件
let btn:UIButton=setButton(rect: rect, title: "开始", htitle: nil, font: font, hfont: nil, titleColor: color, htitleColor: nil, imageName: nil, himageName: nil,bgcolor: bgcolor,action: acs,target:self)
view.addSubview(btn)


 //开始动画
@objc func
         imagv.startAnimating()//开始动画
    }
    
    
   //创建按钮
func setButton(rect:CGRect,title:String?,htitle:String?,font:UIFont?,hfont:UIFont?,titleColor:UIColor?,htitleColor:UIColor?,imageName:String?,himageName:String?,bgcolor:UIColor?,action:Selector?,target:UIViewController?)->UIButton{
        //参数依次是定位,标题,选中时的标题,标题字体大小,选中时的标题字体大小,标题颜色,选中时的标题颜色,图片,选中时的图片
let btn:UIButton=UIButton.init(frame: rect)
if htitle != nil && htitle != ""{//选中时的标题
setTitle(htitle, for: UIControlState.highlighted)
else if title != nil && title != ""{//
setTitle(title, for: UIControlState.normal)
        }
if hfont != nil{//选中时标题字体大小
titleLabel?.font=hfont
else if font != nil{//
titleLabel?.font=font
        }
if htitleColor != nil{//选中时标题颜色
setTitleColor(htitleColor, for: UIControlState.highlighted)
else if titleColor != nil{//
setTitleColor(titleColor, for: UIControlState.normal)
        }
        
if himageName != nil && himageName != ""{//选中时的图片
setImage(UIImage.init(named: himageName!), for: UIControlState.highlighted)
else if imageName != nil && imageName != ""{//
setImage(UIImage.init(named: imageName!), for: UIControlState.normal)
        }
if bgcolor != nil{//背景颜色
backgroundColor=bgcolor
        }
if action != nil{//添加事件
addTarget(target, action: action!, for: UIControlEvents.touchUpInside)
        }
return
    }