mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-30 01:39:20 +00:00
Fix cell background in iOS7
This commit is contained in:
parent
518dd9e9c7
commit
dd5e1d7245
1 changed files with 8 additions and 6 deletions
|
|
@ -122,7 +122,9 @@ static void addRoundedRectToPath(CGContextRef context, CGRect rect, float ovalWi
|
|||
- (void)drawRect:(CGRect)aRect {
|
||||
// Drawing code
|
||||
|
||||
CGContextRef c = UIGraphicsGetCurrentContext();
|
||||
CGContextRef c = UIGraphicsGetCurrentContext();
|
||||
// don't use arcs on iOS >= 7
|
||||
BOOL use_arcs = [[[UIDevice currentDevice] systemVersion] floatValue] < 7;
|
||||
|
||||
int lineWidth = 1;
|
||||
|
||||
|
|
@ -140,8 +142,8 @@ static void addRoundedRectToPath(CGContextRef context, CGRect rect, float ovalWi
|
|||
CGContextSetLineWidth(c, lineWidth);
|
||||
CGContextSetAllowsAntialiasing(c, YES);
|
||||
CGContextSetShouldAntialias(c, YES);
|
||||
|
||||
if (position == UACellBackgroundViewPositionTop) {
|
||||
|
||||
if (position == UACellBackgroundViewPositionTop && use_arcs) {
|
||||
|
||||
miny += 1;
|
||||
|
||||
|
|
@ -166,7 +168,7 @@ static void addRoundedRectToPath(CGContextRef context, CGRect rect, float ovalWi
|
|||
CGContextStrokePath(c);
|
||||
CGContextRestoreGState(c);
|
||||
|
||||
} else if (position == UACellBackgroundViewPositionBottom) {
|
||||
} else if (position == UACellBackgroundViewPositionBottom && use_arcs) {
|
||||
|
||||
CGMutablePathRef path = CGPathCreateMutable();
|
||||
CGPathMoveToPoint(path, NULL, minx, miny);
|
||||
|
|
@ -190,8 +192,8 @@ static void addRoundedRectToPath(CGContextRef context, CGRect rect, float ovalWi
|
|||
CGContextRestoreGState(c);
|
||||
|
||||
|
||||
} else if (position == UACellBackgroundViewPositionMiddle) {
|
||||
|
||||
} else if (position == UACellBackgroundViewPositionMiddle || !use_arcs) {
|
||||
// in iOS7, this will be the default handling
|
||||
CGMutablePathRef path = CGPathCreateMutable();
|
||||
CGPathMoveToPoint(path, NULL, minx, miny);
|
||||
CGPathAddLineToPoint(path, NULL, maxx, miny);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue