Skip to content

Commit

Permalink
fix uitableview scroll up issue, partially
Browse files Browse the repository at this point in the history
  • Loading branch information
zfdang committed Jun 5, 2015
1 parent e640df0 commit ac3f0ef
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion zSMTH/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>533</string>
<string>545</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
Expand Down
6 changes: 3 additions & 3 deletions zSMTH/ViewController/PostContentTableViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -276,14 +276,14 @@ -(void) setCellContent:(SMTHPost*)post
imageview.frame = frame;

// if image was not loaded before, refresh tableview
if(self.delegate && att.loaded == NO){
att.loaded = YES;
if(self.delegate && imageview.loaded == NO){
imageview.loaded = YES;
[self.delegate RefreshTableView];
}
}
}];

if(att.loaded == NO){
if(imageview.loaded == NO){
imageview.frame = CGRectMake(rect.origin.x, curSubviewOffset, 100, 20);
}
[self.cellView addSubview:imageview];
Expand Down
6 changes: 3 additions & 3 deletions zSMTH/ViewController/PostContentTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPa
{
height = [((NSNumber*)result) floatValue];
}
// NSLog(@"%@ height=%f", indexPath, height);

NSLog(@"%d, %f", indexPath.row, height);
return height;
}

Expand Down Expand Up @@ -319,7 +319,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
if(contentType == CONTENT_INBOX) {
cell.postIndex.text = @"发件人";
}

CGFloat height = [cell getCellHeight];
[mHeights setObject:[NSNumber numberWithFloat:height] forKey:indexPath];
}
Expand Down
2 changes: 2 additions & 0 deletions zSMTH/ViewController/TapImageView.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@
@property (weak) id<TapImageViewDelegate> delegate;
@property (nonatomic) long idxPost;
@property (nonatomic) long idxImage;
@property (nonatomic) BOOL loaded;

@end
1 change: 1 addition & 0 deletions zSMTH/ViewController/TapImageView.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ - (id)init
self.clipsToBounds = YES;
self.contentMode = UIViewContentModeScaleAspectFill;
self.userInteractionEnabled = YES;
self.loaded = NO;
}
return self;
}
Expand Down
1 change: 0 additions & 1 deletion zSMTH/libSMTH/SMTHAttachment.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
@property (nonatomic) long attPos;
@property (nonatomic) long attSize;
@property (nonatomic) CGFloat imgHeight;
@property (nonatomic) BOOL loaded;

-(BOOL) isImage;

Expand Down
2 changes: 0 additions & 2 deletions zSMTH/libSMTH/SMTHAttachment.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@ @implementation SMTHAttachment
@synthesize attPos;
@synthesize attSize;
@synthesize imgHeight;
@synthesize loaded;

- (instancetype)init
{
self = [super init];
if (self) {
self.loaded = NO;
}
return self;
}
Expand Down

0 comments on commit ac3f0ef

Please sign in to comment.