From 82597d57da2befa7df899ec0e30f637178364e16 Mon Sep 17 00:00:00 2001 From: Eddie Ehlin Date: Sat, 23 Feb 2013 20:24:52 +0100 Subject: Solved render bug for bean extraction view. Whole view is now based on UITableView and utilizing the footer view support for rendering the note. However, there is one minor issue but it is only visible when having so many beans that the tableview requires scrolling to reach the note (footerinsection shadow) --- iBean/iBean.xcodeproj/project.pbxproj | 6 - .../UserInterfaceState.xcuserstate | Bin 51543 -> 50741 bytes iBean/iBean/BeanCollectionExtractionScrollView.h | 13 -- iBean/iBean/BeanCollectionExtractionScrollView.m | 58 ------- .../iBean/BeanCollectionExtractionViewController.m | 3 + iBean/iBean/iPhoneStoryboard.storyboard | 171 +++++++++------------ 6 files changed, 77 insertions(+), 174 deletions(-) delete mode 100644 iBean/iBean/BeanCollectionExtractionScrollView.h delete mode 100644 iBean/iBean/BeanCollectionExtractionScrollView.m (limited to 'iBean') diff --git a/iBean/iBean.xcodeproj/project.pbxproj b/iBean/iBean.xcodeproj/project.pbxproj index f2f8088..7e41fc4 100644 --- a/iBean/iBean.xcodeproj/project.pbxproj +++ b/iBean/iBean.xcodeproj/project.pbxproj @@ -46,7 +46,6 @@ 0276254816B5BC5300EE2F4E /* ThresholdCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 0276254716B5BC5300EE2F4E /* ThresholdCell.m */; }; 02E557AE16A9C1E40080FBBA /* BeanCollectionExtractionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 02E557AD16A9C1E40080FBBA /* BeanCollectionExtractionViewController.m */; }; 02E557B116A9CFB50080FBBA /* BeanCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 02E557B016A9CFB50080FBBA /* BeanCell.m */; }; - 02E557BA16AC85A20080FBBA /* BeanCollectionExtractionScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 02E557B916AC85A20080FBBA /* BeanCollectionExtractionScrollView.m */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -116,8 +115,6 @@ 02E557AD16A9C1E40080FBBA /* BeanCollectionExtractionViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BeanCollectionExtractionViewController.m; sourceTree = ""; }; 02E557AF16A9CFB50080FBBA /* BeanCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BeanCell.h; sourceTree = ""; }; 02E557B016A9CFB50080FBBA /* BeanCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BeanCell.m; sourceTree = ""; }; - 02E557B816AC85A20080FBBA /* BeanCollectionExtractionScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BeanCollectionExtractionScrollView.h; sourceTree = ""; }; - 02E557B916AC85A20080FBBA /* BeanCollectionExtractionScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BeanCollectionExtractionScrollView.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -349,8 +346,6 @@ 02E557B016A9CFB50080FBBA /* BeanCell.m */, 02E557AC16A9C1E40080FBBA /* BeanCollectionExtractionViewController.h */, 02E557AD16A9C1E40080FBBA /* BeanCollectionExtractionViewController.m */, - 02E557B816AC85A20080FBBA /* BeanCollectionExtractionScrollView.h */, - 02E557B916AC85A20080FBBA /* BeanCollectionExtractionScrollView.m */, ); name = BeanCollectionExtraction; sourceTree = ""; @@ -441,7 +436,6 @@ 024F676D16A4A61D004A1201 /* InstantExtractionViewController.m in Sources */, 02E557AE16A9C1E40080FBBA /* BeanCollectionExtractionViewController.m in Sources */, 02E557B116A9CFB50080FBBA /* BeanCell.m in Sources */, - 02E557BA16AC85A20080FBBA /* BeanCollectionExtractionScrollView.m in Sources */, 0276253916B58D6000EE2F4E /* SettingsViewController.m in Sources */, 0276253C16B59E4C00EE2F4E /* Configuration.m in Sources */, 0276254216B5A64000EE2F4E /* ThresholdListViewController.m in Sources */, diff --git a/iBean/iBean.xcodeproj/project.xcworkspace/xcuserdata/eddiex.xcuserdatad/UserInterfaceState.xcuserstate b/iBean/iBean.xcodeproj/project.xcworkspace/xcuserdata/eddiex.xcuserdatad/UserInterfaceState.xcuserstate index ca9b272..1ef6ee7 100644 Binary files a/iBean/iBean.xcodeproj/project.xcworkspace/xcuserdata/eddiex.xcuserdatad/UserInterfaceState.xcuserstate and b/iBean/iBean.xcodeproj/project.xcworkspace/xcuserdata/eddiex.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/iBean/iBean/BeanCollectionExtractionScrollView.h b/iBean/iBean/BeanCollectionExtractionScrollView.h deleted file mode 100644 index 40ac170..0000000 --- a/iBean/iBean/BeanCollectionExtractionScrollView.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// BeanCollectionExtractionScrollView.h -// iBean -// -// Created by Eddie Ehlin on 2013-01-20. -// Copyright (c) 2013 Eddie Ehlin. All rights reserved. -// - -#import - -@interface BeanCollectionExtractionScrollView : UIScrollView - -@end diff --git a/iBean/iBean/BeanCollectionExtractionScrollView.m b/iBean/iBean/BeanCollectionExtractionScrollView.m deleted file mode 100644 index e1db1d0..0000000 --- a/iBean/iBean/BeanCollectionExtractionScrollView.m +++ /dev/null @@ -1,58 +0,0 @@ -// -// BeanCollectionExtractionScrollView.m -// iBean -// -// Created by Eddie Ehlin on 2013-01-20. -// Copyright (c) 2013 Eddie Ehlin. All rights reserved. -// - -#import "BeanCollectionExtractionScrollView.h" - -@implementation BeanCollectionExtractionScrollView - -- (id)initWithFrame:(CGRect)frame -{ - self = [super initWithFrame:frame]; - if (self) { - // Initialization code - } - return self; -} - -- (void) layoutSubviews -{ - [super layoutSubviews]; - - //Resize the UITableView containing all the beans - UITableView *bt = [self.subviews objectAtIndex:0]; - //1 - Set the height of the table cells - [bt setRowHeight:60.0f]; - //2 - Calculate the total height for the tableview (i.e.: numberOfRows*rowHeight + 10 (pushing down the gradient under last cell)) - bt.frame = CGRectMake(bt.frame.origin.x, bt.frame.origin.y, bt.frame.size.width, ([bt numberOfRowsInSection:0]*bt.rowHeight)+bt.tableFooterView.bounds.size.height+10); - - //Move down the note text view, so that it don't overlaps the table. - UITextView *note = [self.subviews objectAtIndex:1]; - note.frame = CGRectMake(note.frame.origin.x, (bt.frame.origin.y + bt.frame.size.height)+15, note.frame.size.width, note.frame.size.height); - - //Set the content size to the scroll view. - //Note: If the note is hidden, then we should not include it (the same goes for the padding between note and table) - [self setContentSize: CGSizeMake(self.contentSize.width, bt.frame.size.height + (note.isHidden ? -15 : note.frame.size.height))]; - - //http://developer.apple.com/library/ios/#documentation/WindowsViews/Conceptual/UIScrollView_pg/CreatingBasicScrollViews/CreatingBasicScrollViews.html#//apple_ref/doc/uid/TP40008179-CH101-SW14 - UIEdgeInsets insets = UIEdgeInsetsMake(0, 0, /*padding@bottom*/50, 0); - [self setContentInset:insets]; - [self setScrollIndicatorInsets:insets]; - - [super layoutSubviews]; -} - -/* -// Only override drawRect: if you perform custom drawing. -// An empty implementation adversely affects performance during animation. -- (void)drawRect:(CGRect)rect -{ - // Drawing code -} -*/ - -@end diff --git a/iBean/iBean/BeanCollectionExtractionViewController.m b/iBean/iBean/BeanCollectionExtractionViewController.m index 21c27ba..2670f29 100644 --- a/iBean/iBean/BeanCollectionExtractionViewController.m +++ b/iBean/iBean/BeanCollectionExtractionViewController.m @@ -38,6 +38,9 @@ //Bring the extraction timer view on top [self.view bringSubviewToFront:self.extractionTimerView]; + //Set row height for bean table view + [self.beanTableView setRowHeight:60.0f]; + //[self.beanCollectionNoteTextView setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed: @"textview-bg.png"]]]; } diff --git a/iBean/iBean/iPhoneStoryboard.storyboard b/iBean/iBean/iPhoneStoryboard.storyboard index 5856bcd..dc14d97 100644 --- a/iBean/iBean/iPhoneStoryboard.storyboard +++ b/iBean/iBean/iPhoneStoryboard.storyboard @@ -1143,109 +1143,89 @@ - - - - + + + + + + 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. + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - 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. - - - - - - - - - - - - - - - - + + + + + + + - - + + + + - - @@ -1329,9 +1309,6 @@ - - - -- cgit v1.2.3