Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixing tree browser tree thumb size jumping problem.

  • Loading branch information...
commit a6d1305d6ee922ac7f86c0b186f6031411c401c8 1 parent 2b5d56e
@samus samus authored
View
4 ios/Camp Joy Outdoors/Base.lproj/Main_iPhone.storyboard
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4510" systemVersion="12F37" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="8YX-ce-x5E">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4510" systemVersion="12F45" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="8YX-ce-x5E">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3742"/>
</dependencies>
@@ -213,8 +213,8 @@
</constraints>
</tableViewCellContentView>
<connections>
- <outlet property="imageView" destination="dx6-Cd-aCd" id="CV1-gA-hsT"/>
<outlet property="nameLabel" destination="DQl-zI-PgX" id="5nh-s9-olS"/>
+ <outlet property="treeThumb" destination="dx6-Cd-aCd" id="jFV-xh-Zbc"/>
</connections>
</tableViewCell>
</prototypes>
View
2  ios/Camp Joy Outdoors/CJOImageLabelTableViewCell.h
@@ -9,6 +9,6 @@
#import <UIKit/UIKit.h>
@interface CJOImageLabelTableViewCell : UITableViewCell
-@property (weak, nonatomic) IBOutlet UIImageView *imageView;
+@property (weak, nonatomic) IBOutlet UIImageView *treeThumb;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@end
View
20 ios/Camp Joy Outdoors/CJOSpeciesTableViewController.m
@@ -33,16 +33,6 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger
return [[CJOModel trees] count];
}
-- (void)configureCell:(CJOImageLabelTableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath
-{
- CJOTree *tree = [[CJOModel trees] objectAtIndex:indexPath.row];
- cell.nameLabel.text = tree.name;
- NSString * imageName = [NSString stringWithFormat:@"thumb/%@_thumb.jpg", tree.id];
- cell.imageView.contentMode = UIViewContentModeScaleAspectFit;
- UIImage *img = [UIImage imageNamed:imageName];
- cell.imageView.image = img;
-}
-
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
CJOImageLabelTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"tree" forIndexPath:indexPath];
@@ -52,6 +42,16 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
return cell;
}
+- (void)configureCell:(CJOImageLabelTableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath
+{
+ CJOTree *tree = [[CJOModel trees] objectAtIndex:indexPath.row];
+ cell.nameLabel.text = tree.name;
+ NSString * imageName = [NSString stringWithFormat:@"thumb/%@_thumb.jpg", tree.id];
+ cell.treeThumb.contentMode = UIViewContentModeScaleAspectFit;
+ UIImage *img = [UIImage imageNamed:imageName];
+ cell.treeThumb.image = img;
+}
+
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
CJOTree *tree;
Please sign in to comment.
Something went wrong with that request. Please try again.