Question: I am using UIPickerViewController to capture photo, but I am getting layout as below:

![enter image description here](https://i.stack.imgur.com/bH8D1.png)

As you can see in image - The Switch camera button is not showing properly. 

Below is my code 

```
    UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
    imagePickerController.modalPresentationStyle = UIModalPresentationOverCurrentContext;
    imagePickerController.mediaTypes = @[(NSString *)kUTTypeImage];
    imagePickerController.sourceType = type;
    imagePickerController.delegate = self;
    imagePickerController.navigationBarHidden = YES;
    imagePickerController.cameraDevice = UIImagePickerControllerCameraDeviceFront;
    self.imagePickerController = imagePickerController;
    [self presentViewController:self.imagePickerController animated:YES completion:nil];

```

I am not sure what am I doing wrong, Please suggest

Thanks

Answer: 
You need to bind to that page's window's onload event and then print...

```
var app = angular.module('plunker', []);

app.controller('MainCtrl', function($scope, $window) {
  $scope.name = 'World';
  $scope.print = function() {
    var w = $window.open($window.location.href + '#/?_=2323232');
    console.log(w);
    angular.element(w).bind('load', function() {
      w.print();
    });
  };
});

```

Plunk: <http://plnkr.co/edit/DDGsWBnwmfjWHCrKwxlZ?p=preview>
There are two ways to do it

1.$timeout():- it will run in next digest cycle after th html is rendered

2.$scope.$evalAsync():- it will run before angular get rendered on Html

So you can use accordingly