WebView.SetDrawsBackground
--------------------------

Whether to the WebView draws background.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [WebView](component_WebView.md) | [11.5](newinversion115.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |

MBS( "WebView.SetDrawsBackground"; WebViewerRef; Flag ) 

**MBS**( **"WebView.SetDrawsBackground";** /\* Whether to the WebView draws background. \*/  
**$WebViewerRef**; /\* Either the Web Viewer Object Name or the Web Viewer ID as returned by "[WebView.FindByName](WebViewFindByName.md)" function. \*/   
**$Flag**) /\* Pass 1 to draw background or 0 to allow transparency.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| WebViewerRef | Either the Web Viewer Object Name or the Web Viewer ID as returned by "[WebView.FindByName](WebViewFindByName.md)" function. |  |
| Flag | Pass 1 to draw background or 0 to allow transparency. | 0 |

### Result

Returns OK or error.

### Description

Whether to the WebView draws background.  
If background drawing is turned off, the web viewer should allow transparent background.  
e.g. HTML site, where body has a transparent background color in CSS.  
### Examples

Make transparent and then load web content with transparent body:

 Set Variable \[ $r ; Value: MBS ("WebView.setDrawsBackground"; "web"; 0) \]   
Set Variable \[ $r ; Value: MBS ("[WebView.LoadHTML](WebViewLoadHTML.md)"; "web"; "&lt;html&gt;&lt;body style=\\"background-color:transparent;\\"&gt;&lt;p style=\\"background-color: white;\\"&gt;Hello World 2&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;") \]  
### See also

- [WebView.FindByName](WebViewFindByName.md)
- [WebView.GetDrawsBackground](WebViewGetDrawsBackground.md)
- [WebView.LoadHTML](WebViewLoadHTML.md)

### Release notes

- **Version 11.5**
    - Added [WebView.SetDrawsBackground](https://www.mbsplugins.eu/WebViewSetDrawsBackground.shtml) to make WebViewer transparent on MacOS and iOS.

### Blog Entries

- [New in version 11.5 of MBS FileMaker Plugin](https://www.mbsplugins.de/archive/2021-11-30/New_in_version_115_of_MBS_File/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 11.5pr3](https://www.mbsplugins.de/archive/2021-10-25/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [Transparent WebViewer](https://www.mbsplugins.de/archive/2021-10-21/Transparent_WebViewer/monkeybreadsoftware_blog_filemaker)

Created 5th October 2021 , last changed 13th October 2021

  
[WebView.SetCustomUserAgent](WebViewSetCustomUserAgent.md) - [WebView.SetEditable](WebViewSetEditable.md)

[HTML Version](WebViewSetDrawsBackground.shtml)