iOS Guides | Samples

MonoTouch.UIKit.UIWebView Class

A UIView that displays a web browser.

See Also: UIWebView

Syntax

[MonoTouch.Foundation.Register("UIWebView", true)]
[MonoTouch.ObjCRuntime.Unavailable(MonoTouch.ObjCRuntime.PlatformName.TvOS, MonoTouch.ObjCRuntime.PlatformArchitecture.All, null)]
public class UIWebView : UIView, IUIScrollViewDelegate, IDisposable

Remarks

The MonoTouch API supports two styles of event notification: the Objective-C style that uses a delegate class or the C# style using event notifications.

The C# style allows the user to add or remove event handlers at runtime by assigning to the events of properties of this class. Event handlers can be anyone of a method, an anonymous methods or a lambda expression. Using the C# style events or properties will override any manual settings to the Objective-C Delegate or WeakDelegate settings.

The Objective-C style requires the user to create a new class derived from UIWebViewDelegate class and assign it to the UIKit.Delegate property. Alternatively, for low-level control, by creating a class derived from NSObject which has every entry point properly decorated with an [Export] attribute. The instance of this object can then be assigned to the UIWebView.WeakDelegate property.

Related content

Requirements

Namespace: MonoTouch.UIKit
Assembly: monotouch (in monotouch.dll)
Assembly Versions: 0.0.0.0

The members of MonoTouch.UIKit.UIWebView are listed below.

See Also: UIView

Public Constructors

Default constructor that initializes a new instance of this class with no parameters.
A constructor that initializes the object from the data stored in the unarchiver object.
Constructor to call on derived classes to skip initialization and merely allocate the object.
Initializes the UIWebView with the specified frame.
A constructor used when creating managed representations of unmanaged objects; Called by the runtime.

Public Properties

AllowsInlineMediaPlaybackBoolean. If true, then HTML5 videos can play inline, if false then the native fill-screen controller will be used.
AllowsLinkPreviewBoolean. Gets or sets a Boolean value that controls whether the user can preview content by pressing on a link.
AllowsPictureInPictureMediaPlaybackBoolean. Gets or sets a Boolean value that controls whether the view allows PiP playback.
[read-only]
static
AppearanceUIWebView+UIWebViewAppearance. Strongly-typed property that returns the UIAppearance class for this class.
[read-only]
CanGoBackBoolean. This property indicates if it is possible to move backwards through web pages. Read-only.
[read-only]
CanGoForwardBoolean. This property indicates if it is possible to move forwards through the web pages. Read-only.
[read-only]
override
ClassHandleIntPtr. The handle for this class.
DataDetectorTypesUIDataDetectorType. This property holds and instance of UIDataDetectorType that will convert content of the webpage into clickable URL's.
DelegateUIWebViewDelegate. An instance of the MonoTouch.UIKit.UIWebViewDelegate model class which acts as the class delegate.
GapBetweenPagesSingle. The size, in points, between pages.
[read-only]
IsLoadingBoolean. Returns true if the web view is still loading content. Read-only.
KeyboardDisplayRequiresUserActionBoolean. Whether the UIWebView can programmatically display the keyboard.
MediaPlaybackAllowsAirPlayBoolean. Whether AirPlay is allowed from this UIWebView
MediaPlaybackRequiresUserActionBoolean. Whether HTML5 videos requires the user to start playing them. If false, videos play automatically.
[read-only]
PageCountInt32. The number of pages in the UIWebView after layout completes.
PageLengthSingle. The size, in points, of each page.
PaginationBreakingModeUIWebPaginationBreakingMode. Whether column- or page-breaking is used.
PaginationModeUIWebPaginationMode. The UIWebPaginationMode used by this UIWebView.
[read-only]
RequestNSUrlRequest. The URL of the content to load. Read-only.
ScalesPageToFitBoolean. Whether the user may zoom in or out of the web page.
[read-only]
ScrollViewUIScrollView. This is the UIScrollView used for the web view.
ShouldStartLoadUIWebLoaderControl. Delegate invoked by the object to get a value.
SuppressesIncrementalRenderingBoolean. If true, the UIWebView may render content prior to being fully loaded in memory.
WeakDelegateNSObject. An object that can respond to the delegate protocol for this type

Public Methods

static
AppearanceWhenContainedIn(params Type[]) : UIWebView+UIWebViewAppearance
Returns a strongly typed UIAppearance for instances of this class when the view is hosted in the specified hierarchy.
DecelerationEnded(UIScrollView)
Indicates deceleration ended after a rapid scroll.
DecelerationStarted(UIScrollView)
Indicates that scrolling after a fast scroll is going to begin decelerating.
DidZoom(UIScrollView)
Indicates a zoom occurred.
DraggingEnded(UIScrollView, Boolean)
Indicates that dragging has completed.
DraggingStarted(UIScrollView)
Indicates that dragging has begun.
EvaluateJavascript(String) : String
This method runs some Javascript and returns the the results of that scrip.
static
GetAppearance(UITraitCollection) : UIWebView+UIWebViewAppearance
Returns an appearance proxy for the specified traits.
static
GetAppearance(UITraitCollection, params Type[]) : UIWebView+UIWebViewAppearance
Returns an appearance proxy for the specified traits when found in the containers containment hierarchy.
static
GetAppearance<T>() : UIWebView+UIWebViewAppearance
Obtains the appearance proxy UIWebViewAppearance for the subclass of UIWebView.
static
GetAppearance<T>(UITraitCollection) : UIWebView+UIWebViewAppearance
Obtains the appearance proxy UIWebViewAppearance for the subclass of UIWebView.
static
GetAppearance<T>(UITraitCollection) : UIWebView+UIWebViewAppearance
Obtains the appearance proxy UIWebViewAppearance for the subclass of UIWebView.
static
GetAppearance<T>(UITraitCollection, params Type[]) : UIWebView+UIWebViewAppearance
Obtains the appearance proxy UIWebViewAppearance for the subclass of UIWebView that has the specified trait collection when the view is hosted in the specified hierarchy.
GoBack()
Loads the previous URL.
GoForward()
Loads the next URL in the UIWebView's history list.
LoadData(NSData, String, String, NSUrl)
Loads the main page.
LoadHtmlString(String, NSUrl)
Sets the main page content and base URL.
LoadRequest(NSUrlRequest)
Loads the given URL asynchronously.
Reload()
Reloads the current page.
ScrollAnimationEnded(UIScrollView)
Indicates that the animation associated with scrolling has completed.
Scrolled(UIScrollView)
Indicates that the view has scrolled.
ScrolledToTop(UIScrollView)
Indicates that the view has scrolled all the way to its top.
ShouldScrollToTop(UIScrollView) : Boolean
Delegate invoked by the object to get a value.
StopLoading()
This method stops the loading of the web page.
ViewForZoomingInScrollView(UIScrollView) : UIView
Delegate invoked by the object to get a value.
WillEndDragging(UIScrollView, PointF, ref PointF)
Indicates that dragging is about to end.
ZoomingEnded(UIScrollView, UIView, Single)
Indicates that zooming has completed.
ZoomingStarted(UIScrollView, UIView)
Indicates that zooming has begun.

Protected Methods

override
Dispose(Boolean)
Releases the resources used by the UIWebView object.

Public Events

LoadErrorAn event indicating an error in loading.
LoadFinishedAn event indicating the end of loading.
LoadStartedEvent raised by the object.