drawing text using CGContextShowTextAtPoint but text shown is inverted,

后端 未结 2 1839
栀梦
栀梦 2020-12-16 23:08
  - (void)drawRect:(CGRect)rect {
    CGContextRef  context = UIGraphicsGetCurrentContext();


    CGContextSelectFont(context, \"Arial\", 24, kCGEncodingMacRoman);
         


        
相关标签:
2条回答
  • 2020-12-16 23:48

    This is easier:

    - (void)drawRect:(CGRect)rect {
        NSString* string = @"I am Rahul";
        [string drawAtPoint:CGPointMake(80, 80)
                   withFont:[UIFont systemFontOfSize:24]];
    }
    
    0 讨论(0)
  • 2020-12-16 23:53

    You can use this code :

    CGContextSetTextMatrix(context, CGAffineTransformMake(1.0,0.0, 0.0, -1.0, 0.0, 0.0));
    
    0 讨论(0)
提交回复
热议问题