cbanks Active Member Licensed User Longtime User Nov 26, 2014 #1 I have added a webview to my page with this code: Code: Page1.RootPanel.AddView(WebView1, 0, 0dip, 100%x, 100%y) I have this code added to the resize sub: Code: Private Sub Page1_Resize(Width As Int, Height As Int) WebView1.Width = Width WebView1.Height = Height End Sub If I remove the two lines in the resize sub, then when I rotate from portrait to landscape the text doesn't fill up the width of the screen. With the two lines of code in the resize, it does fill the screen width when rotating to lanscape, but the text is much larger. What am I doing wrong? I want the text in the webview to be the same size after rotating the device.
I have added a webview to my page with this code: Code: Page1.RootPanel.AddView(WebView1, 0, 0dip, 100%x, 100%y) I have this code added to the resize sub: Code: Private Sub Page1_Resize(Width As Int, Height As Int) WebView1.Width = Width WebView1.Height = Height End Sub If I remove the two lines in the resize sub, then when I rotate from portrait to landscape the text doesn't fill up the width of the screen. With the two lines of code in the resize, it does fill the screen width when rotating to lanscape, but the text is much larger. What am I doing wrong? I want the text in the webview to be the same size after rotating the device.
Erel B4X founder Staff member Licensed User Longtime User Nov 26, 2014 #2 Why don't you add the WebView with the designer? You can then use anchors to let the WebView fill the screen. The text size is handled by WebView engine automatically. You can try to change WebView.ScaleToFit property. Upvote 0
Why don't you add the WebView with the designer? You can then use anchors to let the WebView fill the screen. The text size is handled by WebView engine automatically. You can try to change WebView.ScaleToFit property.