Skip to content

Commit

Permalink
Added resize masks to the loading view for the AVCaptureScannerView
Browse files Browse the repository at this point in the history
When the device is landscape, and the scanning starts, a loading view shows, but it wasn't stretching correctly in landscape.  This fixes the autoresizemask so it stretches properly.  Fixes #100
  • Loading branch information
Redth committed Mar 31, 2014
1 parent e910417 commit e45daf0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/ZXing.Net.Mobile/iOS/AVCaptureScannerViewController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,13 @@ public void Cancel()

public override void ViewDidLoad ()
{
loadingBg = new UIView (this.View.Frame) { BackgroundColor = UIColor.Black };
loadingView = new UIActivityIndicatorView (UIActivityIndicatorViewStyle.WhiteLarge);
loadingBg = new UIView (this.View.Frame) {
BackgroundColor = UIColor.Black,
AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight
};
loadingView = new UIActivityIndicatorView (UIActivityIndicatorViewStyle.WhiteLarge) {
AutoresizingMask = UIViewAutoresizing.FlexibleMargins
};
loadingView.Frame = new RectangleF ((this.View.Frame.Width - loadingView.Frame.Width) / 2,
(this.View.Frame.Height - loadingView.Frame.Height) / 2,
loadingView.Frame.Width,
Expand Down

0 comments on commit e45daf0

Please sign in to comment.