自定义单元(iPhone-SDK)中文本的格式部分

时间:2022-01-29 10:42:49

Is it possible to format only a part of the text of a string?

是否可能只格式化字符串文本的一部分?

User searches, and if the search entry is found in the array, it will highlight that particular part of the text only.

用户搜索,如果在数组中找到搜索条目,它只会突出显示文本的特定部分。

TIA.

TIA。

1 个解决方案

#1


0  

Not in a standard UILabel, it isn't. You could draw the cell's contents yourself in its -drawRect: method, and draw the string in parts with different attributes. Or you could use one of the several third-party label classes out there that allow this. (For example, Three20's TTStyledLabel.)

不是标准的UILabel,它不是。您可以在它的-drawRect:方法中绘制单元格的内容,并在具有不同属性的部分中绘制字符串。或者你可以使用其中的一个第三方标签类。(例如,Three20 TTStyledLabel。)

#1


0  

Not in a standard UILabel, it isn't. You could draw the cell's contents yourself in its -drawRect: method, and draw the string in parts with different attributes. Or you could use one of the several third-party label classes out there that allow this. (For example, Three20's TTStyledLabel.)

不是标准的UILabel,它不是。您可以在它的-drawRect:方法中绘制单元格的内容,并在具有不同属性的部分中绘制字符串。或者你可以使用其中的一个第三方标签类。(例如,Three20 TTStyledLabel。)