1

我一直在使用 WebView.execute_js() 来弹出一些消息或数据,如下所示

WebView.execute_js("alert('"+message+"')")

但是我们的客户已经指定了警报框的自定义按钮。我们有什么方法可以取得成功。

请制作一些示例代码,因为我对这个框架完全陌生。

谢谢

4

1 回答 1

1

您可以使用Alert.show_popup()来完成此要求。

Alert.show_popup( {
    :message => 'Some message', 
    :title => 'Custom title', 
    :icon => '/public/images/icon.png',
    :buttons => ["Yes", "No"] } )

希望这对您有所帮助http://docs.rhomobile.com/rhodes/device-caps#alerts

于 2013-09-14T18:27:58.210 回答