Last active
August 29, 2015 14:23
-
-
Save fcaldarelli/ee769816bc80fd3b8216 to your computer and use it in GitHub Desktop.
UITableViewCell full width
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
#import <UIKit/UIKit.h> | |
@interface FullWidthTableViewCell : UITableViewCell | |
@end |
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
#import "FullWidthTableViewCell.h" | |
@implementation FullWidthTableViewCell | |
- (void)awakeFromNib { | |
// Initialization code | |
// Remove seperator inset | |
if ([self respondsToSelector:@selector(setSeparatorInset:)]) { | |
[self setSeparatorInset:UIEdgeInsetsZero]; | |
} | |
// Prevent the cell from inheriting the Table View's margin settings | |
if ([self respondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)]) { | |
[self setPreservesSuperviewLayoutMargins:NO]; | |
} | |
// Explictly set your cell's layout margins | |
if ([self respondsToSelector:@selector(setLayoutMargins:)]) { | |
[self setLayoutMargins:UIEdgeInsetsZero]; | |
} | |
} | |
- (void)setSelected:(BOOL)selected animated:(BOOL)animated { | |
[super setSelected:selected animated:animated]; | |
// Configure the view for the selected state | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment