The following sections describe how to resize a WebViewPrefab, CanvasWebViewPrefab, or an IWebView created with Web.CreateWebView().
- How to resize a WebViewPrefab
- How to resize a CanvasWebViewPrefab
- How to resize an IWebView created with Web.CreateWebView()
How to resize a WebViewPrefab
To set a WebViewPrefab's initial size:
- If you created the WebViewPrefab by dragging it into the scene via the Editor, you can adjust the scale of the top-level WebViewPrefab object's transform in the Editor.
- Or if you created the WebViewPrerfab programmatically with WebViewPrefab.Instantiate(), you can pass the initial dimensions as parameters to that method.
To resize a WebViewPrefab at runtime, the application must call WebViewPrefab.Resize() rather than directly manipulating its transform's scale.
How to resize a CanvasWebViewPrefab
A CanvasWebViewPrefab's size and position is determined by its RectTransform. So, you can set or change its size by adjusting its RectTransform in the Editor or programmatically via a script.

Please see the following demo scenes included with 3D WebView for examples:
- CanvasWebViewDemo: Demonstrates positioning a CanvasWebViewPrefab's RectTransform in the Editor.
- CanvasPopupDemo: The CanvasPopupDemo.cs script demonstrates positioning a CanvasWebViewPrefab's RectTransform via a script.
How to resize an IWebView created with Web.CreateWebView()
An application can resize an IWebView created with Web.CreateWebView() using IWebView.Resize(). Note that this will only resize the underlying web browser. It won't automatically resize the mesh or image on which the application is displaying the IWebView's texture, which the application will need to resize separately.