当我使用中文 UITableview 单元格时会进行颜色混合 [英] When I used Chinese UITableview cell will be color blended

查看:18
本文介绍了当我使用中文 UITableview 单元格时会进行颜色混合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我启用模拟器调试选项颜色混合图层"时然后显示不同的结果如下:

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.imgur.com/LYiPCfy.jpg?1

http://i.imgur.com/t7hArne.jpg?1

推荐答案

看起来汉字标签会有一个额外的子层(不是子视图).

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

当我向视图添加两个 UILabel 时,一个是英文字符,一个是中文字符,层次结构略有不同.

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

0x7fd3b972c020 是带有英文字符的UILabel:

(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 = <UILabel: 0x7fd3b972c020; frame = (121 323.5; 133 20.5); text = 'This is just a test.'; autoresize = RM+BM; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x7fd3b972c2b0>>; contents = <CABackingStore 0x7fd3bb0e1530 (buffer [266 41] BGRX8888)>; opaque = YES; allowsGroupOpacity = YES; rasterizationScale = 2; contentsScale = 2>

0x7fd3b95208f0 是带有汉字的UILabel:

(lldb) po [[0x7fd3b95208f0 layer] sublayers]
<CALayerArray 0x7fd3bb0e0c90>(
<_UILabelContentLayer:0x7fd3bb0e0a60; position = CGPoint (68.25 11); bounds = CGRect (0 0; 140.5 29); contents = <CABackingStore 0x7fd3bb0e1180 (buffer [281 58] BGRA8888)>; 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 = <UILabel: 0x7fd3b95208f0; frame = (119.5 351.5; 136 20.5); text = '这只是一个测试。'; autoresize = RM+BM; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x7fd3b950ba70>>; sublayers = (<_UILabelContentLayer: 0x7fd3bb0e0a60>); opaque = YES; allowsGroupOpacity = YES; rasterizationScale = 2; contentsScale = 2>

每个视图都启用了带有白色背景颜色的 opaque.

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

这篇关于当我使用中文 UITableview 单元格时会进行颜色混合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆