English 中文(简体)
• 如何在《可检索的意见书》上发表编辑的网上意见?
原标题:How to make editable WebView on a UITableViewCell?
问题回答

假设如下:

  1. Users do not need advanced editing features (images, bulleted lists, WYSIWYG anything).
  2. Users do not edit HTML markup.
  3. The HTML only includes text and basic formatting like linebreaks and indents.

I would suggest:

  1. Maintain two versions of your HTML content, one that displays in the UIWebView and on that the user can edit. The editable one should have all markup tags stripped and, where sensible, replaced with their corresponding plaintext character(s) (so for instance, replace <br> with ).
  2. Load the HTML version of the content into your table as normal (I assume you are already doing this).
  3. When you table goes into editing more, replace (or overlay) the UIWebView with an editable UITextView populated with your non-HTML version of the content.
  4. When the user indicates they are done editing, take the edited version of the text and invert the replacements you did in step #1 (so for instance, replace every with <br>).
  5. Load the modified string you got in step #4 into the UIWebView. Optionally save it to file if you want the app to remember/retain a persistent history of edits to the field.

虽然,如果你公司认为激励工程师的方式是用终止的方式威胁他们,那么,你确实应当仅仅感谢他们英勇的管理技巧,并走在你的道路上。





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签