ios開發 富文字

2021-07-22 08:10:50 字數 915 閱讀 8657

富文字屬性attributes

1、nsfontattributename: 設定字型字型大小

2、nsforegroundcolorattributename : 設定文字顏色

3、nskernattributename: 設定字元間距

4、nsparagraphstyleattributename: 設定段落樣式

樣式有:linespacing 行間距、paragraphspacing 段落間距、alignment 對齊方式等

5、nsbackgroundcolorattributename: 設定背景顏色

6、nsstrokecolorattributename: 設定文字描邊顏色

注意:如果需要使文字空心則需和nsstrokewidthattributename(設定描邊寬度)一起使用

7、nsstrikethroughstyleattributename:新增刪除線

8、nsunderlinestyleattributename:新增下劃線

9、nsshadowattributename 設定陰影屬性

注意:該屬性單獨設定不太好用,可以和nsverticalglyphformattributename(橫豎排設定)、nsobliquenessattributename(設定字型傾斜)、n***pansionattributename(設定字型加粗)等屬性一起搭配使用

10、nsbackgroundcolorattributename :設定文字背景顏色

11、nsattachmentattributename:設定文字附件

12、nstexteffectattributename: 設定文字特殊效果

13、nswritingdirectionattributename:設定文字方向

以上的富文字屬性總結的並不是很全面,但是基本上常用的都列舉出來了

ios富文字編輯

最近的專案要用到富文字編輯來實現其中的修改文件功能。先是在github是找了一些editor,效果都不是很滿意,多是使用coretext來實現的,但attribute text與html的轉換十分繁鎖,所找到的控制項只有外讀時轉化為html的方法,而沒有載入時轉換到attribute text的方法...

iOS 檢視詳情 富文字

nsstring textstr 周杰倫 jay chou 1979年1月18日出生於台灣省新北市,華語男歌手 詞曲創作人 演員 mv及電影導演 編劇及製作人。2000年發行首張個人 jay 2001年發行 范特西 2002年在中國 新加坡 馬來西亞 美國等地舉辦首場個人世界巡迴演唱會。2003年登...

iOS 富文字屬性

nsfontattributename 設定字型屬性,預設值 字型 helvetica neue 字型大小 12 nsforegroundcolorattributenam 設定字型顏色,取值為 uicolor物件,預設值為黑色 nsbackgroundcolorattributename 設定字型...