|
38 | 38 | #import "AQGridViewCell+AQGridViewCellPrivate.h" |
39 | 39 | #import "UIColor+AQGridView.h" |
40 | 40 | #import <QuartzCore/QuartzCore.h> |
41 | | -#import <objc/runtime.h> |
| 41 | +#import "AQGridViewCell_png.h" |
42 | 42 |
|
43 | 43 | @interface AQGridViewCell () |
44 | 44 | @property (nonatomic, retain) UIView * contentView; |
@@ -297,31 +297,37 @@ - (void) _beginBackgroundHighlight: (BOOL) highlightOn animated: (BOOL) animated |
297 | 297 | { |
298 | 298 | if ( (_cellFlags.usingDefaultSelectedBackgroundView == 1) && (_selectedBackgroundView == nil) ) |
299 | 299 | { |
300 | | - NSString * imageName = @"AQGridSelection.png"; |
| 300 | + unsigned char * pngBytes = AQGridSelection_png; |
| 301 | + NSUInteger pngLength = AQGridSelection_png_len; |
301 | 302 | switch ( _cellFlags.selectionStyle ) |
302 | 303 | { |
303 | 304 | case AQGridViewCellSelectionStyleBlue: |
304 | 305 | default: |
305 | 306 | break; |
306 | 307 |
|
307 | 308 | case AQGridViewCellSelectionStyleGray: |
308 | | - imageName = @"AQGridSelectionGray.png"; |
| 309 | + pngBytes = AQGridSelectionGray_png; |
| 310 | + pngLength = AQGridSelectionGray_png_len; |
309 | 311 | break; |
310 | 312 |
|
311 | 313 | case AQGridViewCellSelectionStyleBlueGray: |
312 | | - imageName = @"AQGridSelectionGrayBlue.png"; |
| 314 | + pngBytes = AQGridSelectionGrayBlue_png; |
| 315 | + pngLength = AQGridSelectionGrayBlue_png_len; |
313 | 316 | break; |
314 | 317 |
|
315 | 318 | case AQGridViewCellSelectionStyleGreen: |
316 | | - imageName = @"AQGridSelectionGreen.png"; |
| 319 | + pngBytes = AQGridSelectionGreen_png; |
| 320 | + pngLength = AQGridSelectionGreen_png_len; |
317 | 321 | break; |
318 | 322 |
|
319 | 323 | case AQGridViewCellSelectionStyleRed: |
320 | | - imageName = @"AQGridSelectionRed.png"; |
| 324 | + pngBytes = AQGridSelectionRed_png; |
| 325 | + pngLength = AQGridSelectionRed_png_len; |
321 | 326 | break; |
322 | 327 | } |
323 | 328 |
|
324 | | - _selectedBackgroundView = [[UIImageView alloc] initWithImage: [UIImage imageNamed: imageName]]; |
| 329 | + NSData *pngData = [NSData dataWithBytesNoCopy: pngBytes length: pngLength freeWhenDone: NO]; |
| 330 | + _selectedBackgroundView = [[UIImageView alloc] initWithImage: [UIImage imageWithData: pngData]]; |
325 | 331 | _selectedBackgroundView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight; |
326 | 332 | _selectedBackgroundView.contentMode = UIViewContentModeScaleToFill; |
327 | 333 | } |
|
0 commit comments