Created
October 6, 2012 20:27
-
-
Save kosso/3846020 to your computer and use it in GitHub Desktop.
Titanium hack : add insetcomplete event to setContentInsets - edit to TiUITableView.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void)setContentInsets_:(id)value withObject:(id)props | |
{ | |
UIEdgeInsets insets = [TiUtils contentInsets:value]; | |
BOOL animated = [TiUtils boolValue:@"animated" properties:props def:NO]; | |
void (^setInset)(void) = ^{ | |
[tableview setContentInset:insets]; | |
}; | |
if (animated) { | |
double duration = [TiUtils doubleValue:@"duration" properties:props def:300]/1000; | |
[UIView animateWithDuration:duration animations:setInset completion:^(BOOL finished){ | |
// NSLog(@"Done!"); | |
[self.proxy fireEvent:@"insetcomplete" withObject:nil]; | |
}]; | |
} | |
else { | |
setInset(); | |
[self.proxy fireEvent:@"insetcomplete" withObject:nil]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment