繁体   English   中英

可编辑Div上的字符数限制

[英]Character Limit on Editable Div

我试图在此可编辑div上添加字符限制。 我应该遵循的最佳方法是什么?

NSString *html = [NSString stringWithFormat:@"<html><head><style>img{height:30px; width:auto;}</style></head><body style=\"background-color: transparent; padding:0; margin:0; background-image:url('%@'); background-repeat: no-repeat;\" ><div id=\"edit\" style=\"padding-top:50px; height:270px; padding-bottom:50px; padding-left:20px; padding-right:20px; \"> <div id=\"editable\" autofocus contenteditable=\"true\" style=\"font-size:25px; overflow:scroll; display:block; height:240px; \"></div></div></body></html>", imageURL];

您可能可以将Java脚本与webview一起使用,

[webView stringByEvaluatingJavaScriptFromString:@"your script"];

这是一篇有助于限制可编辑div中的字符数的帖子

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM