对于Toast消息,我在Swift 5,Xcode 11中使用Toast-Swift来自:Toast-Swift
但是UITableViewController出现问题,当TableView滚动时,该消息显示在屏幕外,用户看不到该消息。
// basic usage
self.view.makeToast("This is a piece of toast")
感谢您的帮助,以便在屏幕上正确显示该消息。问候。
在表视图的超级视图中而不是在表视图本身中显示吐司。如果您使用的是导航控制器,则为:self.navigationController?.view.makeToast("This is a piece of toast")
或直接使用窗口(尽管我不建议这样做):self.view.window?.makeToast("This is a piece of toast")