Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
iOS: Fixed scroll view bug after upgrading to iOS 7 Beta 3.
Related to issue #405.
  • Loading branch information
ycastonguay committed Jul 8, 2013
1 parent a19ffa7 commit ea8ef3e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions MPfm/MPfm.iOS/Classes/Controllers/PlayerViewController.cs
Expand Up @@ -273,12 +273,17 @@ public void AddScrollView(UIViewController viewController)
if (viewController is PlayerMetadataViewController)
_playerMetadataViewController = (PlayerMetadataViewController)viewController;

// Hot fix for iOS 7 Beta 3
int scrollSubviewsLength = 0;
if (scrollView.Subviews != null)
scrollSubviewsLength = scrollView.Subviews.Length;

if (UserInterfaceIdiomIsPhone)
{
viewController.View.Frame = new RectangleF(scrollView.Subviews.Length * scrollView.Frame.Width, 0, scrollView.Frame.Width, scrollView.Frame.Height);
viewController.View.Frame = new RectangleF(scrollSubviewsLength * scrollView.Frame.Width, 0, scrollView.Frame.Width, scrollView.Frame.Height);
scrollView.AddSubview(viewController.View);
pageControl.Pages = scrollView.Subviews.Length;
scrollView.ContentSize = new SizeF(scrollView.Subviews.Length * scrollView.Frame.Width, scrollView.Frame.Height);
pageControl.Pages = scrollSubviewsLength;
scrollView.ContentSize = new SizeF(scrollSubviewsLength * scrollView.Frame.Width, scrollView.Frame.Height);
}
else
{
Expand Down

0 comments on commit ea8ef3e

Please sign in to comment.