Question: I am new to Xamarin iOS development, and wanted to set background as an image of my view.

Is there any way to set background image directly to view?
or
Alternate solution to that is add ImageView control and set image property but in that case how to set height & width of the ImageView control programatically from ViewController.CS file?

Answer: 
In iOS there are two ways of defining the size of a control: AutoLayout or Springs & Struts. If you are using **Auto Layout** in your app (which you really should be), the size of the control can be defined by placing layout constraints on the control using Interface Builder, the Xamarin Studio designer, or programatically.

For **Auto Layout**:

* Pin the leading and top edge of the imageView
* set height and width constraints on the imageView

For **Non-AutoLayout**:

```
myImageView.Frame = new RectangleF(x-coordinate, y-coordinate, width, height);

```
I wasn't able to use.

```
myImageView.Frame = new RectangleF(x-coordinate, y-coordinate, width, height);

```

This worked for me when I wanted to create an image for a navigation titleview.

```
var imageView = new UIImageView(View.Frame);     
imageView.Image = UIImage.FromBundle(“YourImage.png”);          

var imageWidth = NavigationController.NavigationBar.Frame.Size.Width;               
var imageHeight = NavigationController.NavigationBar.Frame.Size.Height;     

imageView.Frame = new CGRect(x, y, imageWidth, imageHeight);        
imageView.ContentMode = UIViewContentMode.ScaleAspectFit;     

NavigationItem.TitleView = imageView;

```