0

I created a Snackbar style messages in Swift for iOS. I need to understand to which view I add the Snackbar as a subview. Example for one of the problems: I have a scrollview with a lot of content. When you press a button somewhere inside the UIScrollView I want the message to pop from the bottom of screen and it will stay at the bottom of the screen even if the user keeps scrolling the UIScrollView. How do I determine which view is above the scrollview for me to add snackbar as a subview to it?

4

2 回答 2

1

将其添加到 View Controller 的内容视图中,并将视图置于顶部。

于 2016-08-10T09:52:27.513 回答
1

您需要创建一个单独的视图,该视图将在您填充它之前隐藏,它会漂浮在滚动视图上。它需要脱离滚动视图的上下文,以便它不会与所有其余内容一起移动。你仍然可以滚动,所以这应该可以解决问题。

于 2016-08-10T09:34:15.927 回答