How to do “actionSheet showFromRect” in iOS 8?

前端 未结 4 468
旧巷少年郎
旧巷少年郎 2021-01-13 16:03

In iOS 7, I show actionSheet by \"showFromRect\":

[actionSheet showFromRect:rect inView:view animated:YES];

But in iOS 8, this doesn\'t wor

4条回答
  •  -上瘾入骨i
    2021-01-13 16:45

    I found out the point is in iOS 7, you show actionSheet in a new window actually when using "showFromRect: inView:" ;

    But in iOS 8 you show the actionSheet just on the view you send in parameters.

    So the solution is to send

    self.superView
        [actionSheet showFromRect:rect inView:[self.superView] animated:YES];
    

    Me and my colleague figured it out by randomly trying.

提交回复
热议问题