通过移动设备以灵活布局从垫工具栏上移出按钮

时间:2018-08-14 09:31:29

标签: angular-material angular-flex-layout

我有一个标题,其中包含2个按钮,当我用移动设备查看它们时,这些按钮会消失。

我在响应式设计中使用了flex-layout。

按钮不应该留在工具栏中吗?

在移动设备中: Demo 1

其他设备: Demo 2

这是我使用的代码:

header.component.html

ResourceLoader.GetForCurrentView("ResourceName");

header.component.scss

func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> \[UITableViewRowAction\]? {


            let backView = UIView(frame: CGRect(x: 0, y: 0, width: 100, height: tableView.frame.size.height))
            backView.backgroundColor = UIColor(red: 239/255.0, green: 34/255.0, blue: 91/255.0, alpha: 1.0)

            let frame = tableView.rectForRow(at: indexPath)


            let myImage = UIImageView(frame: CGRect(x: 20, y: frame.size.height/2-20, width: 35, height: 35))
            myImage.image = UIImage(named: "delete_white")!
            backView.addSubview(myImage)

            let imgSize: CGSize = tableView.frame.size
            UIGraphicsBeginImageContextWithOptions(imgSize, false, UIScreen.main.scale)
            let context = UIGraphicsGetCurrentContext()
            backView.layer.render(in: context!)
            let newImage: UIImage = UIGraphicsGetImageFromCurrentImageContext()!
            UIGraphicsEndImageContext()

            let deleteAction = UITableViewRowAction(style: .destructive, title: "           ") {
                (action, indexPath) in
                self.deleteCartItem(indexPath: indexPath )
                self.addWebtrendsForCart(path: "/Basket/EditBasket", description: "Edit Basket")
            }

             deleteAction.backgroundColor = UIColor(patternImage: newImage)
             return \[deleteAction\]
        }

有什么输入可以解决这个问题吗?

预先感谢您的帮助。

0 个答案:

没有答案