假设如下:
- Users do not need advanced editing features (images, bulleted lists, WYSIWYG anything).
- Users do not edit HTML markup.
- The HTML only includes text and basic formatting like linebreaks and indents.
I would suggest:
- 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
).
- Load the HTML version of the content into your table as normal (I assume you are already doing this).
- 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.
- 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>
).
- 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.
虽然,如果你公司认为激励工程师的方式是用终止的方式威胁他们,那么,你确实应当仅仅感谢他们英勇的管理技巧,并走在你的道路上。