作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 UIWebView
用于创建富文本编辑器。此 Web View 放置在 UITableView
的自定义单元格中。
在 webview 中键入时,我需要更改单元格大小。我想在打字时获得 webview 的高度。 webview 内部没有滚动。
这是webview初始内容,
NSString* plainContent = @"Edit here.....";
NSString* htmlContentString = [NSString stringWithFormat:
@"<html>"
"<body>"
"<div id=\"content\" contenteditable=\"true\" style=\"font-family: Arial\">"
"%@"
"</div>"
"</body></html>", plainContent];
[_webView loadHTMLString:htmlContentString baseURL:nil];
UIWebView
打字时的高度?
最佳答案
因为 UIWebView 是 UITableViewCell 的 subview ,如果你想增加 webview 的大小,你必须增加 UITableView 的大小,请看这个线程,这更接近你想要的。
Can the height of a UITableViewCell be changed without reloading the table view?
increase uitableviewcell height simultaneously increasing the inner UITextView
谢谢。
关于ios - 键入时如何更改 UIWebview 高度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19564295/
我是一名优秀的程序员,十分优秀!