Created
October 10, 2015 00:52
-
-
Save tanshio/a602c137d27bc424be73 to your computer and use it in GitHub Desktop.
Static Cells時の選択色を変更する ref: http://qiita.com/tanshio/items/26ed81d5fd15268abff4
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
UIView *backgroundSelectedCell = [[UIView alloc] init]; | |
[backgroundSelectedCell setBackgroundColor:[UIColor colorWithRed:130/256.0 green:169/256.0 blue:171/256.0 alpha:1.0]]; | |
for (int section = 0; section < [self.tableView numberOfSections]; section++) | |
for (int row = 0; row < [self.tableView numberOfRowsInSection:section]; row++) | |
{ | |
NSIndexPath* cellPath = [NSIndexPath indexPathForRow:row inSection:section]; | |
UITableViewCell* cell = [self.tableView cellForRowAtIndexPath:cellPath]; | |
[cell setSelectedBackgroundView:backgroundSelectedCell]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment