diff --git a/IVPhoneView.podspec b/IVPhoneView.podspec index 42fe397..97e18f7 100644 --- a/IVPhoneView.podspec +++ b/IVPhoneView.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "IVPhoneView" - s.version = "0.2" + s.version = "0.2.1" s.summary = "Basic view containing an iPhone graphic, in which you can place a screenshot. Can be used for onboarding experiences." s.description = <<-DESC @@ -13,7 +13,7 @@ Pod::Spec.new do |s| s.license = { :type => 'Apache License, Version 2.0', :file => 'LICENSE' } s.author = { "Thijs Scheepers" => "thijs@label305.com" } - s.source = { :git => "https://github.com/Label305/IVPhoneView.git", :tag => "0.2" } + s.source = { :git => "https://github.com/Label305/IVPhoneView.git", :tag => "0.2.1" } s.platform = :ios, '7.0' s.requires_arc = true diff --git a/IVPhoneView/IVPhoneView.m b/IVPhoneView/IVPhoneView.m index 2d5b46c..5e04d0c 100644 --- a/IVPhoneView/IVPhoneView.m +++ b/IVPhoneView/IVPhoneView.m @@ -74,10 +74,18 @@ - (void)layoutSubviews { [super layoutSubviews]; - self.viewInPhone.frame = CGRectMake(self.sideBezzel * 1.25, - self.topBezzel + self.sideBezzel * 0.25, - self.bounds.size.width - self.sideBezzel * 2.25, - self.bounds.size.height - self.sideBezzel * 0.25 - self.topBezzel * 2); + if (self.orientation == IVPhoneViewOrientationLandscape) { + self.viewInPhone.frame = CGRectMake(self.topBezzel, + self.sideBezzel * 1.25 , + self.bounds.size.width - self.sideBezzel * 0.25 - self.topBezzel * 2, + self.bounds.size.height - self.sideBezzel * 2.25); + } else { + self.viewInPhone.frame = CGRectMake(self.sideBezzel * 1.25, + self.topBezzel + self.sideBezzel * 0.25, + self.bounds.size.width - self.sideBezzel * 2.25, + self.bounds.size.height - self.sideBezzel * 0.25 - self.topBezzel * 2); + } + [self.viewInPhone setNeedsLayout]; [self setNeedsDisplay]; }