WebView.SetAutoResizingMask
---------------------------

Sets the auto resizing mask.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Webview](component_Webview.md) | [7.5](newinversion75.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |

MBS( "WebView.SetAutoResizingMask"; WebViewerRef; Value ) 

**MBS**( **"WebView.SetAutoResizingMask";** /\* Sets the auto resizing mask. \*/  
**$WebViewerRef**; /\* Either the Web Viewer Object Name or the Web Viewer ID as returned by "[WebView.FindByName](WebViewFindByName.md)" function. \*/   
**$Value**) /\* The new setting.e.g. 4+8 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| WebViewerRef | Either the Web Viewer Object Name or the Web Viewer ID as returned by "[WebView.FindByName](WebViewFindByName.md)" function. |  |
| Value | The new setting. | 4+8 |

### Result

Returns OK or error.

### Description

Sets the auto resizing mask.  
This defines whether web viewer changes its size based on the surrounding window.  
  
| Name | Value | Description |
|---|---|---|
| NotSizable | 0 | The view cannot be resized. |
| MinXMargin | 1 | The left margin between the view and its superview is flexible. |
| WidthSizable | 2 | The view’s width is flexible. |
| MaxXMargin | 4 | The right margin between the view and its superview is flexible. |
| MinYMargin | 8 | The bottom margin between the view and its superview is flexible. |
| HeightSizable | 16 | The view’s height is flexible. |
| MaxYMargin | 32 | The top margin between the view and its superview is flexible. |

  
e.g. the value 18 means the view can resize both horizontally and vertically with the parent view (window).  
  
Added iOS support in version 10.3.  
  
Due to changes in FileMaker 21, the auto resize feature stopped working.  
### Examples

Make the WebViewer stay on position in window:

 MBS ( "WebView.SetAutoResizingMask"; "web"; 4+32 )  
Resize with window growing:

 MBS ( "WebView.SetAutoResizingMask"; $$web ; 4+2+8+16 )  
### See also

- [AVPlayer.GetAutoResizingMask](AVPlayerGetAutoResizingMask.md)
- [AVPlayer.SetAutoResizingMask](AVPlayerSetAutoResizingMask.md)
- [MapView.GetAutoResizingMask](MapViewGetAutoResizingMask.md)
- [MapView.SetAutoResizingMask](MapViewSetAutoResizingMask.md)
- [Preview.GetAutoResizingMask](PreviewGetAutoResizingMask.md)
- [Preview.SetAutoResizingMask](PreviewSetAutoResizingMask.md)
- [TextView.GetAutoResizingMask](TextViewGetAutoResizingMask.md)
- [TextView.SetAutoResizingMask](TextViewSetAutoResizingMask.md)
- [WebView.FindByName](WebViewFindByName.md)
- [WebView.GetAutoResizingMask](WebViewGetAutoResizingMask.md)

### Release notes

- **Version 7.5**
    - Added [WebView.GetAutoResizingMask](http://www.mbsplugins.eu/WebViewGetAutoResizingMask.shtml) and [WebView.SetAutoResizingMask](http://www.mbsplugins.eu/WebViewSetAutoResizingMask.shtml) to decide on window resize behavior for web viewer.

### Example Databases

- [WebViewer/Custom WebView](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebViewer/Custom%20WebView.shtml#1ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 7.5pr8](https://www.mbsplugins.de/archive/2017-11-18/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 14th November 2017 , last changed 17th October 2024

  
[WebView.SetAllowsLinkPreview](WebViewSetAllowsLinkPreview.md) - [WebView.SetCustomUserAgent](WebViewSetCustomUserAgent.md)

[HTML Version](WebViewSetAutoResizingMask.shtml)