在单元格上滑动时,它会移动一些标签项目

时间:2015-10-11 19:07:28

标签: ios swift uitableview

这有点奇怪。当我在单元格上滑动以报告攻击性帖子时,标签和图像查看项目会移动。我附上了这种情况的GIF。

enter image description here

以下是我的行动代码。

override func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [AnyObject]?  {
    // 1

    var shareAction = UITableViewRowAction(style: UITableViewRowActionStyle.Default, title: "Report" , handler: { (action:UITableViewRowAction!, indexPath:NSIndexPath!) -> Void in
        // 2

        let shareMenu = UIAlertController(title: nil, message: "Offensive?", preferredStyle: .ActionSheet)

        let twitterAction = UIAlertAction(title: "Yes", style: UIAlertActionStyle.Default, handler: nil)

        let cancelAction = UIAlertAction(title: "Nevermind", style: UIAlertActionStyle.Cancel, handler: nil)

        shareMenu.addAction(twitterAction)
        shareMenu.addAction(cancelAction)


        self.presentViewController(shareMenu, animated: true, completion: nil)
    })
    // 3
    shareAction.backgroundColor = UIColor(red: 86.0/255, green: 199.0/255, blue: 217.0/255, alpha: 0.0)


    // 5
    return [shareAction]
}

我非常想知道为什么会这样。

0 个答案:

没有答案
相关问题