Skip to content

Commit

Permalink
Fix Example iPad bottom inset
Browse files Browse the repository at this point in the history
  • Loading branch information
kirpichenko committed Nov 25, 2013
1 parent 18e5c74 commit 8a380d4
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 35 deletions.
2 changes: 1 addition & 1 deletion Example/EKKeyboardAvoidingScrollViewExample/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
[self setTabBarController:[UITabBarController new]];
[self.tabBarController setViewControllers:@[
[[UINavigationController alloc] initWithRootViewController:controller],
[MultipleScrollsViewController new]
[[UINavigationController alloc] initWithRootViewController:[MultipleScrollsViewController new]]
]];

[self setTabBarItemWithText:@"Single Scroll" forControllerAtIndex:0];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ @implementation MultipleScrollsViewController
#pragma mark -
#pragma mark life cycle

- (id)init
{
if (self = [super init]) {
[self setAutomaticallyAdjustsScrollViewInsets:NO];
}
return self;
}

- (void)viewDidLoad
{
[super viewDidLoad];
Expand All @@ -47,6 +39,16 @@ - (void)viewDidLoad

}

- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];

UIEdgeInsets autoInset = [self.scrollView contentInset];
autoInset.bottom = 0;
self.scrollView.contentInset = autoInset;
self.scrollView.scrollIndicatorInsets = autoInset;
}

#pragma mark - UITableViewDataSource

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,6 @@
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" id="4">
<rect key="frame" x="384" y="354" width="384" height="670"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMinY="YES" heightSizable="YES"/>
<color key="backgroundColor" red="0.64613589189999998" green="1" blue="0.67744123229999997" alpha="1" colorSpace="calibratedRGB"/>
<inset key="contentInset" minX="0.0" minY="0.0" maxX="0.0" maxY="49"/>
<inset key="scrollIndicatorInsets" minX="0.0" minY="0.0" maxX="0.0" maxY="49"/>
<string key="text">Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.</string>
<fontDescription key="fontDescription" type="system" pointSize="26"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="11">
<rect key="frame" x="0.0" y="354" width="384" height="670"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="0.84376405139999999" blue="0.80910894389999999" alpha="1" colorSpace="calibratedRGB"/>
<inset key="contentInset" minX="0.0" minY="0.0" maxX="0.0" maxY="49"/>
<inset key="scrollIndicatorInsets" minX="0.0" minY="0.0" maxX="0.0" maxY="49"/>
<connections>
<outlet property="dataSource" destination="-1" id="16"/>
</connections>
</tableView>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" id="12">
<rect key="frame" x="0.0" y="0.0" width="768" height="354"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" flexibleMaxY="YES"/>
Expand Down Expand Up @@ -76,9 +56,27 @@
</label>
</subviews>
<color key="backgroundColor" red="0.72369522050000001" green="0.85519012250000004" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<inset key="contentInset" minX="0.0" minY="64" maxX="0.0" maxY="0.0"/>
<inset key="scrollIndicatorInsets" minX="0.0" minY="64" maxX="0.0" maxY="0.0"/>
</scrollView>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" id="4">
<rect key="frame" x="384" y="354" width="384" height="670"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMinY="YES" heightSizable="YES"/>
<color key="backgroundColor" red="0.64613589189999998" green="1" blue="0.67744123229999997" alpha="1" colorSpace="calibratedRGB"/>
<inset key="contentInset" minX="0.0" minY="0.0" maxX="0.0" maxY="56"/>
<inset key="scrollIndicatorInsets" minX="0.0" minY="0.0" maxX="0.0" maxY="56"/>
<string key="text">Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.</string>
<fontDescription key="fontDescription" type="system" pointSize="26"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="11">
<rect key="frame" x="0.0" y="354" width="384" height="670"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="0.84376405139999999" blue="0.80910894389999999" alpha="1" colorSpace="calibratedRGB"/>
<inset key="contentInset" minX="0.0" minY="0.0" maxX="0.0" maxY="56"/>
<inset key="scrollIndicatorInsets" minX="0.0" minY="0.0" maxX="0.0" maxY="56"/>
<connections>
<outlet property="dataSource" destination="-1" id="16"/>
</connections>
</tableView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics" statusBarStyle="blackOpaque"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,9 @@
</label>
</subviews>
<color key="backgroundColor" red="0.64613589189999998" green="1" blue="0.67744123229999997" alpha="1" colorSpace="calibratedRGB"/>
<inset key="contentInset" minX="0.0" minY="64" maxX="0.0" maxY="0.0"/>
<inset key="scrollIndicatorInsets" minX="0.0" minY="64" maxX="0.0" maxY="0.0"/>
</scrollView>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="16">
<rect key="frame" x="0.0" y="178.99999997755162" width="160" height="388"/>
<rect key="frame" x="0.0" y="178.99999996629779" width="160" height="388"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES"/>
<color key="backgroundColor" red="0.72369522050000001" green="0.85519012250000004" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<inset key="contentInset" minX="0.0" minY="0.0" maxX="0.0" maxY="49"/>
Expand All @@ -70,7 +68,7 @@
</connections>
</tableView>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" id="17">
<rect key="frame" x="160" y="179" width="160" height="388"/>
<rect key="frame" x="160" y="178.99999996629779" width="160" height="388"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMinY="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="0.84376405139999999" blue="0.80910894389999999" alpha="1" colorSpace="calibratedRGB"/>
<inset key="contentInset" minX="0.0" minY="0.0" maxX="0.0" maxY="49"/>
Expand Down

0 comments on commit 8a380d4

Please sign in to comment.