0
我想從警報動作中刪除標題部分。 製作標題字符串""
不會刪除標題部分如何使警報動作無標題
@IBAction func addImage(sender: AnyObject!) {
let alert:UIAlertController = UIAlertController(title: "" ,message: nil, preferredStyle: UIAlertControllerStyle.ActionSheet)
let cameraAction = UIAlertAction(title: "Take Photo", style: UIAlertActionStyle.Default)
{
UIAlertAction in
self.openCamera()
}
let gallaryAction = UIAlertAction(title: "Choose Photo", style: UIAlertActionStyle.Default)
{
UIAlertAction in
self.openGallary()
}
let cancelAction = UIAlertAction(title: "Cancel", style: UIAlertActionStyle.Cancel)
{
UIAlertAction in
}
// Add the actions
alert.addAction(cameraAction)
alert.addAction(gallaryAction)
alert.addAction(cancelAction)
// Present the controller
self.presentViewController(alert, animated: true, completion: nil)
}
這就是我得到:
如何刪除標題節中的所有在一起嗎?
您是否嘗試過傳遞'nil'而不是空字符串?這是一個可選值 – bobDevil
ahh ..這很有效。如果你想發佈它作爲答案,我會接受它。 –