コード例 #1
0
 /// <summary>
 /// Sets whether the device back button should be enabled to execute "go back" or "closing" operation.
 ///
 /// On Android, the device back button in navigation bar will navigate users to a back page. If there is
 /// no any back page avaliable, the back button clicking will try to raise a `OnShouldClose` event and try
 /// to close the web view if `true` is return from the event. If the `OnShouldClose` is not listened,
 /// the web view will be closed and the UniWebView component will be destroyed to release using resource.
 ///
 /// Listen to `OnKeyCodeReceived` if you need to disable the back button, but still want to get the back
 /// button key pressing event.
 ///
 /// Default is enabled.
 /// </summary>
 /// <param name="enabled">Whether the back button should perform go back or closing operation to web view.</param>
 public void SetBackButtonEnabled(bool enabled)
 {
     #if UNITY_ANDROID && !UNITY_EDITOR
     UniWebViewInterface.SetBackButtonEnabled(listener.Name, enabled);
     #endif
 }