0

この編集可能な 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];
4

1 に答える 1

1

おそらく、次を使用して webview で Java スクリプトを使用できます。

[webView stringByEvaluatingJavaScriptFromString:@"your script"];

これは、編集可能な div の文字数を制限するのに役立つ投稿です。

于 2012-04-24T04:53:59.263 に答える