吐司的showMessage函数未出现在XLPagerTabStrip中

时间:2018-12-19 05:18:22

标签: ios iphone swift xcode macos

我正在使用XLPagerTabStrip,并且其中有两个子视图。在子视图中,我正在使用showMessage函数来打印错误消息的吐司,但该吐司未显示在视图中。

if ( debit_amount > availBal_Amount )
{
    self.showMessage("NO_SUFFICIENT_BAL", type: .error, options: [.position(.bottom),.textNumberOfLines(0)])
}

这是showMessage函数:

open func showMessage(_ text: String,
                      type: GSMessageType,
                      options: [GSMessageOption]? = nil) {
    GSMessage.showMessageAddedTo(text: text, type: type, options: options, inView: view, inViewController: self)    }

仅在XLPagerTabStrip视图showMessage()中无效。

请帮助我解决问题。

1 个答案:

答案 0 :(得分:0)

我使用了以下代码,并且消息将显示在容器视图上。 为此,在viewController中创建了一个对象。

$(BUILD):
    mkdir -p $@

$(EXECUTABLE) : $(OBJECTS) | $(BUILD)
    $(CC) $(OBJECTS) -o $@

Its work for me.