search

Home  >  Q&A  >  body text

ios - swift 做这个功能应该怎么入手操作?


界面是这样的。。


需要了解怎么实现的部分(简称shopcartview)


点击button之后会弹出一个带有蒙版层的tableview

目前遇到的问题:(不需要其他的动画效果,只是第一步实现功能)
1.在shopcartview中怎么实现点击button后,会有一个tableview从下往上拉出来的动画,这个应该怎么实现?

我的理解,给button一个action,但是我创建界面的时候是一个view,所以不能用presentview这个方法,所以我在想这个下面的view是不是由另一个VC在控制,但是这个view不是在现在的这个VC上面么。。。。好了 我已经被绕晕了。

然后点击button如果前面成功了的话,这个蒙版应该怎么创建,是弄一个view 设置alpha = 0.5 这种 然后再添加上一个tableview吗?

2.里面数据应该是怎么进行传递的,在外面的tableview里面选择的菜品 会在shopcartview里面进行成列,并且可以进行添加和删除的操作。这个是怎么实现的?

我的理解,首先要实现前面,我已经炸了,这个就猜猜看应该是,用delegate的方法 edit 这种解决吧。

3.怎么设置button的tag = index path.row ? 我在select里面弄不出来。。。是不是方法不对?

我的理解,给每一个cell的button一个tag 然后 传递这个tag获取数据。。。不知道方向对不对

希望有代码可以解决一下问题,等待中。。。

阿神阿神2889 days ago351

reply all(3)I'll reply

  • 天蓬老师

    天蓬老师2017-04-17 17:44:00

    Button’s tag=indexpath.row can customize an NSInteger, and then let button.tag = NSInteger, and then let indexpath.row= NSInteger in the select method, which is equivalent to building a bridge to indirectly connect the two. Get up

    reply
    0
  • 黄舟

    黄舟2017-04-17 17:44:00

    tableView can be given to childVC. The mask is a View, set to gray with transparency,

    reply
    0
  • 怪我咯

    怪我咯2017-04-17 17:44:00

    It doesn’t matter if the shopping cart view is just a view. Add a tableView on top of the view

    reply
    0
  • Cancelreply