谷歌发布API Swift

谷歌发布API Swift,swift,google-api,uiappearance,Swift,Google Api,Uiappearance,我试图定制表格单元格分隔符的颜色,但它没有生效,为什么 autocompleteController.tableCellSeparatorColor=UIColor(红色:CGFloat(255/255.0)、绿色:CGFloat(255/255.0)、蓝色:CGFloat(255/255.0)、alpha:1.0) 供参考: 非常感谢您的帮助 class selectAddress:UIViewController{ //按下按钮时,显示自动完成视图控制器。 //@iAction func自动

我试图定制表格单元格分隔符的颜色,但它没有生效,为什么

autocompleteController.tableCellSeparatorColor=UIColor(红色:CGFloat(255/255.0)、绿色:CGFloat(255/255.0)、蓝色:CGFloat(255/255.0)、alpha:1.0)

供参考:

非常感谢您的帮助

class selectAddress:UIViewController{
//按下按钮时,显示自动完成视图控制器。
//@iAction func自动完成单击(\uSender:ui按钮){
覆盖函数视图显示(u动画:Bool){
设autocompleteController=GMSAutocompleteViewController()
autocompleteController.delegate=self
autocompleteController.tableCellBackgroundColor=UIColor(红色:CGFloat(35/255.0)、绿色:CGFloat(35/255.0)、蓝色:CGFloat(43/255.0)、alpha:1.0)
autocompleteController.primaryTextColor=UIColor.gray
autocompleteController.tableCellSeparatorColor=UIColor(红色:CGFloat(255/255.0)、绿色:CGFloat(255/255.0)、蓝色:CGFloat(255/255.0)、alpha:1.0)
autocompleteController.primaryTextHighlightColor=UIColor.white
autocompleteController.secondaryTextColor=UIColor.white
如果打开==“否”{
self.present(自动完成控制器,动画:true,完成:nil)
opened=“是”
}否则{
opened=“否”
性能检查(标识符为“venueSave”,发送方:self)
}
// }
}
}
分机选择地址:GMSAutocompleteViewControllerDelegate{
//处理用户的选择。
func viewController(viewController:GMSAutocompleteViewController,didAutocompleteWith place:GMSPlace){
打印(“地名:\(地点)”)
打印(“地点地址:\(Place.formattedAddress)”)
打印(“地点属性:\(地点属性)”)
打印(“经度:\(地点.坐标.经度)”)
打印(“纬度:\(地点.坐标.纬度)”)
打印(“地址组件:\(place.addressComponents)”)
让city=place.addressComponents?[2]。名称
打印(“CITYYYY\(城市!)”)
/*
var request=URLRequest(url:url(字符串):https://www.asmserver.co.uk/barduo/addvenue.php")!)
request.httpMethod=“POST”
让postString=“name=\(facebookID!)&email=\(email!)&firstname=\(firstname!)&lastname=\(lastname!)&link=\(link!)”
打印(postString)
request.httpBody=postString.data(使用:.utf8)
让task=URLSession.shared.dataTask(with:request){data,response,中的错误
guard let data=data,error==nil else{//检查基本网络错误
打印(“错误=\(错误)”)
返回
}
如果让httpStatus=响应为?HTTPURLResponse,则httpStatus.statusCode!=200{//检查http错误
打印(“状态代码应为200,但为\(httpStatus.statusCode)”)
打印(“响应=\(响应)”)
}
let responseString=String(数据:数据,编码:.utf8)
打印(“****\(responseString!)”)
defaults.set(“\(responseString!)”,forKey:“id”)
DispatchQueue.main.async{
self.performsgue(带有标识符:“goNext”,发送者:self)
}
}
task.resume()
*/
驳回(动画:真,完成:无)
}
func viewController(viewController:GMSAutocompleteViewController,DidFailAutoCompleteWither错误:错误){
//TODO:处理错误。
打印(“错误:,错误。本地化描述)
}
//用户取消了操作。
取消了func(viewController:GMSAutocompleteViewController){
驳回(动画:真,完成:无)
}
//再次打开和关闭网络活动指示灯。
func didRequestAutocompletePredictions(viewController:GMSAutocompleteViewController){
UIApplication.shared.isNetworkActivityIndicatorVisible=true
}
func didUpdateAutocompletePredictions(viewController:GMSAutocompleteViewController){
UIApplication.shared.isNetworkActivityIndicatorVisible=false
}
func viewController(viewController:gmsautompleteviewcontroller!,didfailautocompletewitheror错误:NSError!){
//TODO:处理错误。
打印(“错误:”,错误。说明)
}
}

我将相关行更改为:

GMSAutocompleteViewController().tableCellSeparatorColor=UIColor.white

此时将显示白色分隔符