CGContext and retina display

后端 未结 4 1147
面向向阳花
面向向阳花 2021-01-02 23:38

guys, this is my code:

- (void) renderPageAtIndex:(NSUInteger)index inContext:(CGContextRef)ctx {
    //background
    CGContextSetFillColorWithColor(ctx, [[         


        
4条回答
  •  时光说笑
    2021-01-03 00:01

    Try setting the layers contentScale variable like this:

    layer.contentsScale = [UIScreen mainScreen].scale;
    

    This should make the code adapt to retina/nonretina displays.

提交回复
热议问题