<div class="meta" robots="noindex">

</div>

Class

# iOSImageView

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2020r2. Please use `MobileImageViewer</api/user_interface/mobile/mobileimageviewer>` as a replacement.

</div>

## Description

Displays an image.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                                  | Type                                      | Read-Only | Shared |
|-------------------------------------------------------|-------------------------------------------|-----------|--------|
| `AccessibilityHint<iosimageview.accessibilityhint>`   | `Text</api/deprecated/text>`              |           |        |
| `AccessibilityLabel<iosimageview.accessibilitylabel>` | `Text</api/deprecated/text>`              |           |        |
| `ContentMode<iosimageview.contentmode>`               | `ContentModes<iosimageview.contentmodes>` |           |        |
| `Height<iosimageview.height>`                         | `Double</api/data_types/double>`          | ✓         |        |
| `Image<iosimageview.image>`                           | `iOSImage</api/deprecated/iosimage>`      |           |        |
| `Left<iosimageview.left>`                             | `Double</api/data_types/double>`          | ✓         |        |
| `Name<iosimageview.name>`                             | `Text</api/deprecated/text>`              | ✓         |        |
| `Parent<iosimageview.parent>`                         | `iOSControl</api/deprecated/ioscontrol>`  | ✓         |        |
| `Top<iosimageview.top>`                               | `Double</api/data_types/double>`          | ✓         |        |
| `Visible<iosimageview.visible>`                       | `Boolean</api/data_types/boolean>`        |           |        |
| `Width<iosimageview.width>`                           | `Double</api/data_types/double>`          | ✓         |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                              | Parameters                                                         | Returns                                                   | Shared |
|---------------------------------------------------|--------------------------------------------------------------------|-----------------------------------------------------------|--------|
| `AddConstraint<iosimageview.addconstraint>`       | constraint As `iOSLayoutConstraint</api/ios/ioslayoutconstraint>`  |                                                           |        |
| `AddControl<iosimageview.addcontrol>`             | child As `MobileControl</api/user_interface/mobile/mobilecontrol>` |                                                           |        |
| `Control<iosimageview.control>`                   | index As `Integer</api/data_types/integer>`                        | `MobileControl</api/user_interface/mobile/mobilecontrol>` |        |
| `ControlCount<iosimageview.controlcount>`         |                                                                    | `Integer</api/data_types/integer>`                        |        |
| `Handle<iosimageview.handle>`                     |                                                                    | `Ptr</api/data_types/additional_types/ptr>`               |        |
| `Invalidate<iosimageview.invalidate>`             |                                                                    |                                                           |        |
| `RemoveConstraint<iosimageview.removeconstraint>` | constraint As `iOSLayoutConstraint</api/ios/ioslayoutconstraint>`  |                                                           |        |
| `RemoveControl<iosimageview.removecontrol>`       | child As `MobileControl</api/user_interface/mobile/mobilecontrol>` |                                                           |        |
| `SetTintColor<iosimageview.settintcolor>`         | value As `Color</api/data_types/color>`                            |                                                           |        |

## Events

<div class="rst-class">

table-centered_column_4

</div>

| Name                        | Parameters | Returns |
|-----------------------------|------------|---------|
| `Close<iosimageview.close>` |            |         |
| `Open<iosimageview.open>`   |            |         |

## Enumerations

<div id="iosimageview.contentmodes">

<div class="rst-class">

forsearch

</div>

</div>

iOSImageView.ContentModes

### ContentModes

ScaleToFill, ScaleAspectFit, ScaleAspectFill, Center, Top, Bottom, Left, Right, TopLeft, TopRight, BottomLeft, BottomRight

| Enum            | Description                                                                                           |
|-----------------|-------------------------------------------------------------------------------------------------------|
| ScaleToFill     | The image's aspect ratio is ignored and the image is stretched to fit within the bounds of the frame. |
| ScaleAspectFit  | Scales the image until it fits entirely, maintaining aspect.                                          |
| ScaleAspectFill | Scales the image until it fills the ImageView entirely, maintaining aspect.                           |
| Center          | The image is centered within the frame.                                                               |
| Top             | The image is positioned with its top at the top of the frame.                                         |
| Bottom          | The image is positioned with its bottom at the bottom of the frame.                                   |
| Left            | The image is positioned with its left at the left of the frame.                                       |
| Right           | The image is positioned with its right at the right of the frame.                                     |
| TopLeft         | The image is positioned with its top left at the top left of the frame.                               |
| TopRight        | The image is positioned with its top right at the top right of the frame.                             |
| BottomLeft      | The image is positioned with its bottom left at the bottom left of the frame.                         |
| BottomRight     | The image is positioned with its bottom right at the bottom right of the frame.                       |

## Property descriptions

<div id="iosimageview.accessibilityhint">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSImageView.AccessibilityHint

**AccessibilityHint** As `Text</api/deprecated/text>`

The accessibility hint is a longer description that is read aloud when VoiceOver is enabled.

``` xojo
Me.AccessibilityHint = "Click to calculate the value and display the next view."
```

<div id="iosimageview.accessibilitylabel">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSImageView.AccessibilityLabel

**AccessibilityLabel** As `Text</api/deprecated/text>`

The accessibility label of of a control is a short name that is read aloud when VoiceOver is enabled.

``` xojo
Me.AccessibilityLabel = "Calculate the value."
```

<div id="iosimageview.contentmode">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSImageView.ContentMode

**ContentMode** As `ContentModes<iosimageview.contentmodes>`

Specifies the way the picture gets displayed using the `ContentModes<iosimageview.contentmodes>` enumeration.

Center the image within the frame:

``` xojo
Me.ContentMode = iOSImageView.ContentModes.Center
```

<div id="iosimageview.height">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSImageView.Height

**Height** As `Double</api/data_types/double>`

The height of the control.

This property is read-only.

<div id="iosimageview.image">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSImageView.Image

**Image** As `iOSImage</api/deprecated/iosimage>`

The image to display.

Display an image in the project:

``` xojo
Me.Image = MyCompanyLogo
```

<div id="iosimageview.left">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSImageView.Left

**Left** As `Double</api/data_types/double>`

The left position of the control.

This property is read-only.

<div id="iosimageview.name">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSImageView.Name

**Name** As `Text</api/deprecated/text>`

The name of the control. This can only be set in the Inspector. Use the name to refer to the control.

This property is read-only.

<div id="iosimageview.parent">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSImageView.Parent

**Parent** As `iOSControl</api/deprecated/ioscontrol>`

Indicates the control's parent object, if it has one. If there is no parent, this is Nil.

This property is read-only.

<div id="iosimageview.top">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSImageView.Top

**Top** As `Double</api/data_types/double>`

The top position of the control.

This property is read-only.

<div id="iosimageview.visible">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSImageView.Visible

**Visible** As `Boolean</api/data_types/boolean>`

Indicates whether the control is visible.

Make a button invisible:

``` xojo
Button1.Visible = False
```

<div id="iosimageview.width">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSImageView.Width

**Width** As `Double</api/data_types/double>`

The width of the control.

This property is read-only.

## Method descriptions

<div id="iosimageview.addconstraint">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSImageView.AddConstraint

**AddConstraint**(constraint As `iOSLayoutConstraint</api/ios/ioslayoutconstraint>`)

Adds a constraint to the control. This constraint is used by child controls that have been added to this control.

<div id="iosimageview.addcontrol">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSImageView.AddControl

**AddControl**(child As `MobileControl</api/user_interface/mobile/mobilecontrol>`)

Adds a child control to the control.

<div id="iosimageview.control">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSImageView.Control

**Control**(index As `Integer</api/data_types/integer>`) As `MobileControl</api/user_interface/mobile/mobilecontrol>`

Gets the child control at the specified index.

<div id="iosimageview.controlcount">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSImageView.ControlCount

**ControlCount** As `Integer</api/data_types/integer>`

The number of child controls in the control.

<div id="iosimageview.handle">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSImageView.Handle

**Handle** As `Ptr</api/data_types/additional_types/ptr>`

The handle is used to get a reference to the control for interfacing directly with the iOS API.

<div id="iosimageview.invalidate">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSImageView.Invalidate

**Invalidate**

Marks the control so that it will be redrawn during the next event loop.

Call Invalidate to force a Canvas to redraw itself:

``` xojo
Canvas1.Invalidate
```

<div id="iosimageview.removeconstraint">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSImageView.RemoveConstraint

**RemoveConstraint**(constraint As `iOSLayoutConstraint</api/ios/ioslayoutconstraint>`)

Removes a constraint from the control.

<div id="iosimageview.removecontrol">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSImageView.RemoveControl

**RemoveControl**(child As `MobileControl</api/user_interface/mobile/mobilecontrol>`)

Removes the control from the control.

<div id="iosimageview.settintcolor">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSImageView.SetTintColor

**SetTintColor**(value As `Color</api/data_types/color>`)

Changes a control's tint color. This varies by control and for some controls may not do anything. For example, with an `MobileTextField</api/user_interface/mobile/mobiletextfield>` this changes the cursor color.

## Event descriptions

<div id="iosimageview.close">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSImageView.Close

**Close**

Called when the control is removed from its container, such as a view.

<div id="iosimageview.open">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

iOSImageView.Open

**Open**

Called after the control is created. This is where you typically put initialization code.

Set label text in Open event:

``` xojo
Me.Text = "Hello"
```

## Sample code

This code adds an <span class="title-ref">iOSImageView</span> instance programmatically to the default main project view. The item "AppleImage" is an `Picture</api/graphics/picture>` instance added to the Project Browser from the Library.

This code is executed from the Open Event Handler in the default "View1" iOSView.

``` xojo
Var iv As New iOSImageView

iv.ContentMode = iOSImageView.ContentModes.ScaleAspectFit ' Set how the image will be displayed in the iOSImageView view
iv.Image = AppleImage

me.AddControl iv

' Applying constraints to the superview (View1), so they set the position and size of the iOSImageView when displayed
' (size and position = centered with a marging of 50 points from the parent view edges)

Var RightC As New iOSLayoutConstraint(iv,iOSLayoutConstraint.AttributeTypes.Right, iOSLayoutConstraint.RelationTypes.Equal, _
self, iOSLayoutConstraint.AttributeTypes.Right,1.0,-50)

Var LeftC As New iOSLayoutConstraint(iv,iOSLayoutConstraint.AttributeTypes.left, iOSLayoutConstraint.RelationTypes.Equal, _
self, iOSLayoutConstraint.AttributeTypes.Left,1.0,50)

Var TopC As New iOSLayoutConstraint(iv,iOSLayoutConstraint.AttributeTypes.Top, iOSLayoutConstraint.RelationTypes.Equal, _
self, iOSLayoutConstraint.AttributeTypes.Top,1.0,50)

Var BottomC As New iOSLayoutConstraint(iv,iOSLayoutConstraint.AttributeTypes.Bottom, iOSLayoutConstraint.RelationTypes.Equal, _
self, iOSLayoutConstraint.AttributeTypes.bottom,1.0,-50)

me.AddConstraint RightC
me.AddConstraint LeftC
me.AddConstraint TopC
me.AddConstraint BottomC
```

## Compatibility

iOS projects on the iOS operating system.

## See also

`MobileControl</api/user_interface/mobile/mobilecontrol>` parent class; `Picture</api/graphics/picture>` class
