ZSSRichTextEditor 設(shè)置字號
CSS 文檔 fontSize 在插入點(diǎn)或者選中文字部分修改字體大小. 需要提供一個(gè)HTML字體尺寸 (1-7) 作為參數(shù)丑念。
1. 在ZSSRichTextEditor.m 文件添加接口
/** font 1-7 */
- (void)setFontSize:(int)font {
NSString *normal = [NSString stringWithFormat:@"zss_editor.setFontSize(\"%d\");",font];
[self.editorView stringByEvaluatingJavaScriptFromString:normal];
}
2. ZSSRichTextEditor.js 文件中添加接口
zss_editor.setFontSize = function(aFontSize) {
document.execCommand("styleWithCSS", null, true);
document.execCommand('fontSize', false, aFontSize);
document.execCommand("styleWithCSS", null, false);
zss_editor.enabledEditingItems();
}
CSS-SetFontSize文檔
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者