ZSSRichTextEditor setFontSize
ZSSRichTextEditor 设置字号
CSS 文档 fontSize 在插入点或者选中文字部分修改字体大小. 需要提供一个HTML字体尺寸 (1-7) 作为参数。
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文档
本文标题:ZSSRichTextEditor setFontSize
本文链接:https://www.haomeiwen.com/subject/jzhqdftx.html
网友评论