Created
December 11, 2013 07:36
-
-
Save vitoziv/7906394 to your computer and use it in GitHub Desktop.
NoShadowTableView - Removing reorder cell shadows from a UITableView
This file contains hidden or 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
#import "NoShadowTableView.h" | |
@interface NoShadowTableView () | |
{ | |
// iOS7 | |
__weak UIView* wrapperView; | |
} | |
@end | |
@implementation NoShadowTableView | |
- (void) didAddSubview:(UIView *)subview | |
{ | |
[super didAddSubview:subview]; | |
// iOS7 | |
if(wrapperView == nil && [[[subview class] description] isEqualToString:@"UITableViewWrapperView"]) | |
wrapperView = subview; | |
// iOS6 | |
if([[[subview class] description] isEqualToString:@"UIShadowView"]) | |
[subview setHidden:YES]; | |
} | |
- (void) layoutSubviews | |
{ | |
[super layoutSubviews]; | |
// iOS7 | |
for(UIView* subview in wrapperView.subviews) | |
{ | |
if([[[subview class] description] isEqualToString:@"UIShadowView"]) | |
[subview setHidden:YES]; | |
} | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment