How to overlay EditText on TextView just after the end of text

为君一笑 提交于 2019-12-05 20:04:43

i think the best way would be to create your own editText view . however, this is probably a very hard thing to do.

if you are short in time , you can use HTML and use a webView to show the content . i'm pretty sure that in html this task is much easier , as it's already implemented in many places.


EDIT:

another solution is to use FlowTextView library . it extends from RelativeLayout, but acts as a textView. i didn't test it but only ran their sample (via a cool app called DevAppDirect)

Alex Lockwood

It doesn't seem like there is an easy way to do this without making your own layout manager. See this post for a line-breaking widget layout implementation. You can also achieve something similar by using Romain Guy's FlowLayout implementation.

I've never used either of these implementations before to achieve the "fill-in-the-blank" effect you described, but it seems to me that you would need to add the TextView and EditText objects via the layout's addView method. You might have to experiment a little to get it working correctly, but I think this should help you get on the right track.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!