Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/114.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c iPad3 shouldRasterize=YES会切断UILabel文本_Objective C_Ios_Uilabel_Calayer - Fatal编程技术网

Objective c iPad3 shouldRasterize=YES会切断UILabel文本

Objective c iPad3 shouldRasterize=YES会切断UILabel文本,objective-c,ios,uilabel,calayer,Objective C,Ios,Uilabel,Calayer,在图层上将shouldRasterize设置为YES时出现问题。在iPad3上,label.text将文本从底部切掉约1/5的大小。有人知道问题出在哪里吗 cellview.layer.cornerRadius = 12.0; cellview.layer.borderColor = [UIColor blackColor].CGColor; cellview.layer.borderWidth = 1.0; cellview.layer.frame = rect

在图层上将
shouldRasterize
设置为
YES
时出现问题。在iPad3上,label.text将文本从底部切掉约1/5的大小。有人知道问题出在哪里吗

    cellview.layer.cornerRadius = 12.0;
    cellview.layer.borderColor = [UIColor blackColor].CGColor;
    cellview.layer.borderWidth = 1.0;
    cellview.layer.frame = rect;
    cellview.layer.shouldRasterize =YES;
    cellview.layer.masksToBounds = YES;

在iPad2上,它工作正常。

设置光栅化的比例,因为iPad3的视网膜显示:

[cellview.layer setRasterizationScale:[[UIScreen mainScreen] scale]];
Swift版本:

cellview.layer.rasterizationScale = UIScreen.main.scale
Swift 4版本
令人惊叹的。谢谢!
cellView.layer.rasterizationScale = UIScreen.main.scale