When I used Chinese UITableview cell will be color blended

后端 未结 2 1290
陌清茗
陌清茗 2021-01-16 00:10

When I enable my simulator debug option \"Color blended laysers\" Then showing the different result as follow:

Sorry that I can not post images:

http://i.img

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-16 01:03

    It looks like labels with Chinese characters will have an extra sublayer (not subviews).

    When I add two UILabels to a view, one with English characters and one with Chinese, there are slightly different hierarchies.

    0x7fd3b972c020 is the UILabel with English characters:

    (lldb) po [[0x7fd3b972c020 layer] sublayers]
     nil
    (lldb) po [0x7fd3b972c020 layer]
    <_UILabelLayer:0x7fd3b972c2b0; position = CGPoint (187.5 333.75); bounds = CGRect (0 0; 133 20.5); delegate = >; contents = ; opaque = YES; allowsGroupOpacity = YES; rasterizationScale = 2; contentsScale = 2>
    

    0x7fd3b95208f0 is the UILabel with Chinese characters:

    (lldb) po [[0x7fd3b95208f0 layer] sublayers]
    (
    <_UILabelContentLayer:0x7fd3bb0e0a60; position = CGPoint (68.25 11); bounds = CGRect (0 0; 140.5 29); contents = ; allowsGroupOpacity = YES; rasterizationScale = 2; contentsScale = 2>
    )
    
    
    (lldb) po [0x7fd3b95208f0 layer]
    <_UILabelLayer:0x7fd3b950ba70; position = CGPoint (187.5 361.75); bounds = CGRect (0 0; 136 20.5); delegate = >; sublayers = (<_UILabelContentLayer: 0x7fd3bb0e0a60>); opaque = YES; allowsGroupOpacity = YES; rasterizationScale = 2; contentsScale = 2>
    

    Each of the views have opaque enabled with white background colors.

提交回复
热议问题