简体   繁体   中英

Firemonkey TWebBrowser input alternative?

As Embarcadero said :

" WebBrowser Does Not Accept Keyboard Input on Android

On Android devices, the on-screen keyboard is not available in a TWebBrowser control. This means that a user cannot complete a web form, for example. The TWebBrowser control should be used for displaying information or documents. User interaction should be performed with FireMonkey controls. "

Link

This is very annoying if we have to use Clouds identification pages like Dropbox or Google Drive.

Using Delphi XE5 with REST components, I'm able to open the login pages, but the keyboard is not functional on Android.

So how can I use FireMonkey controls to perform interactions as Embarcadero said : User interaction should be performed with FireMonkey controls. ?

EDIT :

Delphi XE 6 seems to be the only nice solution :

Updates to TWebBrowser : The web browser available on Windows (SHDocVw.TWebBrowser) has been updated to the latest version of Internet Explorer.

The trick is give the focus to the WebBrowser component:

procedure TFormBrowserAdd.ButtonNavigateClick(Sender: TObject);
begin
  WebBrowser.CanFocus := True;
  WebBrowser.Navigate(EditUrl.Text);
  WebBrowser.SetFocus;
end;

But, after that the back key will not work correctly so you have to manage in other way. For example i have used a button on my form.

您必须在加载页面末尾的Web浏览器上设置foucs

procedure TfrmMain.BrowserDidFinishLoad(ASender: TObject);
begin
Browser.CanFocus := True;
Browser.SetFocus;
end;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM