Package | com.distriqt.extension.nativewebview |
Class | public class WebViewOptions |
Inheritance | WebViewOptions ![]() |
Property | Defined By | ||
---|---|---|---|
allowInlineMediaPlayback : Boolean = false
A Boolean value that determines whether HTML5 videos play inline or use the native full-screen controller. | WebViewOptions | ||
allowScrolling : Boolean = true
If false the user will not be able to scroll the web view, either horizontally or vertically. | WebViewOptions | ||
allowZooming : Boolean = true
Enables/disables pinch to zoom on the content. | WebViewOptions | ||
autoScale : Boolean = false | WebViewOptions | ||
backgroundColour : int = 0xCCCCCC
The default background colour displayed behind the web content. | WebViewOptions | ||
backgroundEnabled : Boolean = true
Whether the background is enabled. | WebViewOptions | ||
bounces : Boolean = true
Controls whether the scroll view bounces past the edge of content and back again
If the value of this property is true, the scroll view
bounces when it encounters a boundary of the content. | WebViewOptions | ||
cachePolicy : int = -1
Set the cache policy for the webview. | WebViewOptions | ||
disableLongPressGestures : Boolean = false
On iOS, setting this to true will disable the long press magnification gesture. | WebViewOptions | ||
enableDebugging : Boolean = false
Set this flag to true To enable debugging in your webview,
including making the webview "inspectable". | WebViewOptions | ||
geolocationEnabled : Boolean = true
Set to true to enable geolocation positioning in your webpage. | WebViewOptions | ||
geolocationUsageDescription : String
On Android this message is displayed when the user is prompted to allow
a web page access to their geolocation. | WebViewOptions | ||
keyboardDisplayRequiresUserAction : Boolean = true
iOS Only
When this property is set to true, the user must
explicitly tap the elements in the web view to display the keyboard
(or other relevant input view) for that element. | WebViewOptions | ||
linkTargetAction : String
Defines the action to use when handling target="_blank" links. | WebViewOptions | ||
mediaCapturePermissionGrantType : String = prompt
This property specifies how to handle media capture permission requests. | WebViewOptions | ||
mediaPlaybackRequiresUserAction : Boolean = true
A Boolean value that determines whether HTML5 videos can play
automatically (false) or require the user to start playing them (true). | WebViewOptions | ||
scrollBarStyle : String = default
Set the scroll bar style, either default, light or dark. | WebViewOptions | ||
useWebKitIfAvailable : Boolean = true Deprecated: WKWebView is always used now, UIWebView has been removed from the SDK
Attempts to use a WebKit based browser if available on the device. | WebViewOptions |
Method | Defined By | ||
---|---|---|---|
Constructor
| WebViewOptions | ||
setLinkTargetActionForUrl(action:String, urlFilter:String):WebViewOptions
Defines the action to use when handling target="_blank" links
overriding the generic linkTargetAction action for the specified URL. | WebViewOptions | ||
setMediaCapturePermissionGrantType(type:String):WebViewOptions | WebViewOptions |
Constant | Defined By | ||
---|---|---|---|
SCROLLBAR_DARK : String = dark [static]
Dark scrollbar style appropriate for light content
| WebViewOptions | ||
SCROLLBAR_DEFAULT : String = default [static]
Default style scrollbar, appropriate for most content
| WebViewOptions | ||
SCROLLBAR_LIGHT : String = light [static]
Light scrollbar style appropriate for dark content
| WebViewOptions |
allowInlineMediaPlayback | property |
public var allowInlineMediaPlayback:Boolean = false
A Boolean value that determines whether HTML5 videos play inline or use the native full-screen controller.
iOS: In order for video to play inline, not only does this property need to be set on the view, but the video element in the HTML document must also include the webkit-playsinline attribute.
allowScrolling | property |
public var allowScrolling:Boolean = true
If false the user will not be able to scroll the web view, either horizontally or vertically. The default is true which allows the user to scroll to see all of the web view content.
allowZooming | property |
public var allowZooming:Boolean = true
Enables/disables pinch to zoom on the content. If false zooming is disabled and the content size will not be able to be changed.
autoScale | property |
public var autoScale:Boolean = false
backgroundColour | property |
public var backgroundColour:int = 0xCCCCCC
The default background colour displayed behind the web content. This colour is seen when you drag past the bounds of the content.
backgroundEnabled | property |
public var backgroundEnabled:Boolean = true
Whether the background is enabled. If false then the background will be transparent and flash content will display through the webview.
This is the background of the view, behind the web content.
Note: You may need to check the background colour of the body of the html and potentially add style="background-color:transparent;" to the body tag.
Some older Android versions don't support this option. It should be supported on most 4.4+ versions, however it will work on some older versions as well.
bounces | property |
public var bounces:Boolean = true
Controls whether the scroll view bounces past the edge of content and back again
If the value of this property is true
, the scroll view
bounces when it encounters a boundary of the content.
Bouncing visually indicates that scrolling has reached an edge of the content.
If the value is false
, scrolling stops immediately
at the content boundary without bouncing.
iOS only
cachePolicy | property |
public var cachePolicy:int = -1
Set the cache policy for the webview. Allows control of the policy used regarding the caching of web requests.
iOS
On iOS this sets the cachePolicy of the NSURLRequest
used to load the page
Android On Android this sets the cache policy of the WebView and of the HttpUrlConnection used to load the url.
See also
disableLongPressGestures | property |
public var disableLongPressGestures:Boolean = false
On iOS, setting this to true will disable the long press magnification gesture.
Currently only works for the UIWebView implementation,
i.e. when useWebKitIfAvailable
is false
On Android, this will disable the long press context menu for copy paste functionality.
enableDebugging | property |
public var enableDebugging:Boolean = false
Set this flag to true
To enable debugging in your webview,
including making the webview "inspectable".
geolocationEnabled | property |
public var geolocationEnabled:Boolean = true
Set to true to enable geolocation positioning in your webpage.
geolocationUsageDescription | property |
public var geolocationUsageDescription:String
On Android this message is displayed when the user is prompted to allow a web page access to their geolocation.
On iOS this message should be defined in your info additions using the
NSLocationWhenInUseUsageDescription
key.
<key>NSLocationWhenInUseUsageDescription</key> <string>Your message goes here</string>
keyboardDisplayRequiresUserAction | property |
public var keyboardDisplayRequiresUserAction:Boolean = true
iOS Only
When this property is set to true
, the user must
explicitly tap the elements in the web view to display the keyboard
(or other relevant input view) for that element.
When set to false
, a focus event on an element
causes the input view to be displayed and associated with
that element automatically.
linkTargetAction | property |
linkTargetAction:String
Defines the action to use when handling target="_blank"
links.
The default will load the link in the current webview.
public function get linkTargetAction():String
public function set linkTargetAction(value:String):void
See also
mediaCapturePermissionGrantType | property |
public var mediaCapturePermissionGrantType:String = prompt
This property specifies how to handle media capture permission requests.
Defaults to PermissionGrantType.PROMPT
, resulting in the user being prompted repeatedly.
Supported:
See also
mediaPlaybackRequiresUserAction | property |
public var mediaPlaybackRequiresUserAction:Boolean = true
A Boolean value that determines whether HTML5 videos can play
automatically (false
) or require the user to start playing them (true
).
scrollBarStyle | property |
public var scrollBarStyle:String = default
Set the scroll bar style, either default, light or dark. Allows you to select an appropriate style for your content.
useWebKitIfAvailable | property |
public var useWebKitIfAvailable:Boolean = true
Attempts to use a WebKit based browser if available on the device.
On iOS, if the WebKit Web View is available then it will be used, and fall back to the UI Web View. If false, UI Web View will always be used.
WebViewOptions | () | Constructor |
public function WebViewOptions()
Constructor
setLinkTargetActionForUrl | () | method |
public function setLinkTargetActionForUrl(action:String, urlFilter:String):WebViewOptions
Defines the action to use when handling target="_blank"
links
overriding the generic linkTargetAction
action for the specified URL.
If the url contains the string in the urlFilter then the action is applied to this link.
Supported:
Parameters
action:String | |
urlFilter:String |
WebViewOptions — WebViewOptions instance for chaining calls
|
setMediaCapturePermissionGrantType | () | method |
public function setMediaCapturePermissionGrantType(type:String):WebViewOptions
Parameters
type:String |
WebViewOptions |
See also
SCROLLBAR_DARK | Constant |
public static const SCROLLBAR_DARK:String = dark
Dark scrollbar style appropriate for light content
SCROLLBAR_DEFAULT | Constant |
public static const SCROLLBAR_DEFAULT:String = default
Default style scrollbar, appropriate for most content
SCROLLBAR_LIGHT | Constant |
public static const SCROLLBAR_LIGHT:String = light
Light scrollbar style appropriate for dark content