Skip to content

Commit aafdf61

Browse files
author
jlorich
committed
Merge pull request #80 from cloudspace/70590978_3_5_inch_fixes
Fix 3.5 inch layout issues
2 parents 3b93543 + 8d48a96 commit aafdf61

4 files changed

Lines changed: 27 additions & 12 deletions

File tree

EasyReader/Application/Controllers/Home/EZRHomeViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ - (void)viewDidLayoutSubviews
171171
{
172172
[super viewDidLayoutSubviews];
173173
[self layOutVerticalScrollView];
174-
174+
175175
gradient.frame = self.view.bounds;
176176
gradient.gradientRadius = CGRectGetWidth(self.view.frame)/2.0f;
177177
gradient.gradientOrigin = CGPointMake(CGRectGetWidth(self.view.frame)/2.0,100);

EasyReader/Application/Controllers/Home/FeedItemCollectionView/EZRFeedItemCollectionView.m

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ - (id)initWithCoder:(NSCoder *)aDecoder {
2727

2828
flowLayout = [[UICollectionViewFlowLayout alloc] init];
2929

30-
CGFloat width = CGRectGetWidth(self.frame);
31-
CGFloat height = CGRectGetHeight(self.frame);
32-
33-
flowLayout.itemSize = CGSizeMake(width, height);
34-
3530
flowLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
3631
flowLayout.minimumInteritemSpacing = 0;
3732
flowLayout.minimumLineSpacing = 0;
@@ -44,6 +39,15 @@ - (id)initWithCoder:(NSCoder *)aDecoder {
4439
return self;
4540
}
4641

42+
- (void)layoutSubviews {
43+
[super layoutSubviews];
44+
45+
CGFloat width = CGRectGetWidth(self.frame);
46+
CGFloat height = CGRectGetHeight(self.frame);
47+
48+
flowLayout.itemSize = CGSizeMake(width, height);
49+
}
50+
4751

4852
#pragma mark - Property implementations
4953

EasyReader/Application/Controllers/Menu/EZRMenuViewController.m

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ @implementation EZRMenuViewController
5353

5454
/// A temporary store for the menu height since it's made small when the keyboard shows
5555
CGFloat originalMenuHeight;
56+
57+
/// Has the inital menu height been set to the frame (can not rely on autolayout since we're changing it when
58+
/// the keyboard shows
59+
BOOL hasSetMenuHeight;
5660
}
5761

5862
#pragma mark - UIViewController Lifecycle methods
@@ -85,6 +89,14 @@ - (void)viewDidLoad
8589
[self observeObject:self.currentFeedsProvider property:@"feeds" withSelector:@selector(feedsDidChange:feeds:)];
8690
}
8791

92+
- (void)viewDidLayoutSubviews {
93+
if (!hasSetMenuHeight) {
94+
self.menuHeight.constant = CGRectGetHeight(self.view.frame);
95+
hasSetMenuHeight = YES;
96+
[self.view layoutSubviews];
97+
}
98+
}
99+
88100
- (void)applyMenuStyles
89101
{
90102
UIImageView *background = [[UIImageView alloc] initWithFrame:self.view.frame];

EasyReader/Application/Views/Main_iPhone.storyboard

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="5053" systemVersion="13C64" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="Hgn-0q-Z1W">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="5056" systemVersion="13C1021" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="Hgn-0q-Z1W">
33
<dependencies>
44
<deployment defaultVersion="1792" identifier="iOS"/>
55
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
@@ -124,7 +124,7 @@
124124
</cells>
125125
</collectionView>
126126
<pageControl opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" numberOfPages="3" translatesAutoresizingMaskIntoConstraints="NO" id="ZJR-Bc-2rZ" customClass="CSCollectionPageControl">
127-
<rect key="frame" x="0.0" y="535" width="320" height="37"/>
127+
<rect key="frame" x="0.0" y="531" width="320" height="37"/>
128128
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
129129
<constraints>
130130
<constraint firstAttribute="height" constant="37" id="IOR-d8-478"/>
@@ -134,7 +134,7 @@
134134
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
135135
<constraints>
136136
<constraint firstItem="ZJR-Bc-2rZ" firstAttribute="leading" secondItem="wv0-Kq-lEd" secondAttribute="leading" id="4rH-P3-1FM"/>
137-
<constraint firstAttribute="bottom" secondItem="ZJR-Bc-2rZ" secondAttribute="bottom" constant="-4" id="Udw-oK-lYS"/>
137+
<constraint firstAttribute="bottom" secondItem="ZJR-Bc-2rZ" secondAttribute="bottom" id="Udw-oK-lYS"/>
138138
<constraint firstItem="xvT-99-V3u" firstAttribute="top" secondItem="wv0-Kq-lEd" secondAttribute="top" id="eeM-6n-6rD"/>
139139
<constraint firstAttribute="trailing" secondItem="ZJR-Bc-2rZ" secondAttribute="trailing" id="g71-Kw-bfi"/>
140140
<constraint firstAttribute="trailing" secondItem="xvT-99-V3u" secondAttribute="trailing" id="i4C-E3-DhH"/>
@@ -167,17 +167,16 @@
167167
<constraints>
168168
<constraint firstItem="wv0-Kq-lEd" firstAttribute="width" secondItem="8sx-gS-Wib" secondAttribute="width" id="FjT-9R-6Wt"/>
169169
<constraint firstItem="EWA-9Z-pb1" firstAttribute="leading" secondItem="8sx-gS-Wib" secondAttribute="leading" id="GLA-9c-NmZ"/>
170-
<constraint firstAttribute="height" secondItem="xvT-99-V3u" secondAttribute="height" id="IyD-bO-ocB"/>
171170
<constraint firstItem="EWA-9Z-pb1" firstAttribute="top" secondItem="u5l-1H-L35" secondAttribute="bottom" id="R3e-Eb-s6m"/>
172171
<constraint firstItem="lzz-HQ-Mp2" firstAttribute="top" secondItem="EWA-9Z-pb1" secondAttribute="bottom" id="XH9-7e-hB0"/>
173-
<constraint firstItem="xvT-99-V3u" firstAttribute="height" secondItem="8sx-gS-Wib" secondAttribute="height" id="gj6-Uu-uBO"/>
172+
<constraint firstAttribute="width" secondItem="xvT-99-V3u" secondAttribute="width" id="ZdL-6d-zjQ"/>
174173
<constraint firstAttribute="trailing" secondItem="EWA-9Z-pb1" secondAttribute="trailing" id="otM-Jz-ztm"/>
174+
<constraint firstAttribute="height" secondItem="xvT-99-V3u" secondAttribute="height" id="qli-2m-aSN"/>
175175
<constraint firstItem="wv0-Kq-lEd" firstAttribute="height" secondItem="8sx-gS-Wib" secondAttribute="height" id="xJM-P3-M8C"/>
176176
</constraints>
177177
</view>
178178
<nil key="simulatedStatusBarMetrics"/>
179179
<nil key="simulatedTopBarMetrics"/>
180-
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
181180
<size key="freeformSize" width="320" height="568"/>
182181
<connections>
183182
<outlet property="button_leftMenu" destination="wb1-Na-kaO" id="0oK-RY-cyj"/>

0 commit comments

Comments
 (0)