Skip to content

Commit

Permalink
Fix UINavigationBar and UITableViewCell to use CGColor
Browse files Browse the repository at this point in the history
  • Loading branch information
msft-Jeyaram committed Apr 27, 2017
1 parent e5e0182 commit d6f0988
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Frameworks/UIKit/UINavigationBar.mm
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ - (instancetype)initWithFrame:(CGRect)pos {

[super initWithFrame:pos];

[[self layer] setBackgroundColor:(CGColorRef)[UIColor whiteColor]];
[[self layer] setBackgroundColor:CGColorGetConstantColor(kCGColorWhite)];
_font = [UIFont boldSystemFontOfSize:18];
(_backButton)
.attach([[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStylePlain target:self action:@selector(backClicked)]);
Expand Down Expand Up @@ -653,7 +653,7 @@ - (void)setBarTintColor:(UIColor*)color {
size.height = 10.0f;
UIGraphicsBeginImageContextWithOptions(size, 1, 2.0f);
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(ctx, (CGColorRef)(UIColor*)_barTintColor);
CGContextSetFillColorWithColor(ctx, [(UIColor*)_barTintColor CGColor]);
CGRect rct = { 0, 0, 0, 0 };
rct.size = size;
CGContextFillRect(ctx, rct);
Expand Down
5 changes: 3 additions & 2 deletions Frameworks/UIKit/UITableViewCell.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1090,10 +1090,11 @@ - (void)dealloc {

- (void)_addBottomBorder:(UITableView*)parentTable {
if (_borderView == nil) {
const __CGColorQuad* color = [[parentTable backgroundColor] _getColors];
const CGFloat* color = CGColorGetComponents([[parentTable backgroundColor] CGColor]);

UIColor* backgroundColor = nil;

if ((color == nullptr) || (color->a == 0.0f) || (color->r == 1.0f && color->g == 1.0f && color->b == 1.0f && color->a == 1.0f)) {
if ((color == nullptr) || (color[3] == 0.0f) || (color[0] == 1.0f && color[1] == 1.0f && color[2] == 1.0f && color[3] == 1.0f)) {
backgroundColor = [UIColor grayColor];
} else {
backgroundColor = [UIColor whiteColor];
Expand Down

0 comments on commit d6f0988

Please sign in to comment.