iOS Question blank Webview

Hccsoft

Member
Licensed User
Longtime User
Hello,

I create a simple layer with buttons, imageviewer with Visual Designer. The same code works with B4A but I don't now why with IOS don't work. I try WebView1.LoadURL and WebView1.LoadHtml. I can see the buttons, the image but the webviewer don't show anything.

B4X:
Private WebView1 As WebView

Private Sub Application_Start (Nav As NavigationController)
    NavControl = Nav
    Page1.Initialize("Vista_web")
    Page1.Title = "Lectura"

    Page1.RootPanel.LoadLayout("vista_web")
    Page1.RootPanel.Color = Colors.White
    NavControl.ShowPage(Page1)
    WebView1.Initialize("webview1")
    WebView1.LoadHtml("http://www.google.com")
End Sub   

Sub WebView1_Click
   WebView1.LoadURL ("http://www.google.com")
End Sub


End Sub

Thanks
 

Baris Karadeniz

Active Member
Licensed User
Erel, I did it like you said. It works now. Thanks. But it doesn't fit the all screen. How can I provide to fit all screen whatever the phone size? Second question is; when pdf file is opened at the web site how can I go back?
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
Erel, I did it like you said. It works now. Thanks. But it doesn't fit the all screen. How can I provide to fit all screen whatever the phone size? Second question is; when pdf file is opened at the web site how can I go back?
Go to desginer. In general script , type
webview1.width = 100%x
webview1.height= 100%y

this will fit all the screen.
 
Upvote 0

Baris Karadeniz

Active Member
Licensed User
Thanks. It is ok now. And when one button at the web page is pressed, user manual (pdf) is opened at the screen. I can not go back. How can I go back? May be when the button is pressed pdf file should be downloaded. How can I provide go back or download pdf file?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

iCAB

Well-Known Member
Licensed User
Longtime User
The above code is wrong. You need to add WebView with the designer and you shouldn't initialize it in the code.
Erel, are you saying WebView cannot be added in code with B4I ( it works for me with B4A, but I am getting a blank screen with B4I )
Please clarify
 
Upvote 0

iCAB

Well-Known Member
Licensed User
Longtime User
You are right it works .. hopefully for my next app I will try to use the designer, but honestly I have done lots of work to avoid using the designer in order to support different screen resolutions and sizes etc... but I guess the designer got a lot more powerful and if I am not mistaken all of that is handled by the designer now. Is that correct?
 
Upvote 0
Top