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

I am trying to create a paragraph of text using TextView and need to insert EditText in between text like fill in the blanks. Is it possible to build custom view like that ? As I am new in this forum I could post any image. It should look somewhat like below:

World is a common name for the whole of human [EDIT TEXT], specifically human experience, history, or the human condition in general, worldwide, i.e. anywhere on Earth.[2]

In a [EDIT TEXT] context it may refer to: (1) the whole of the physical Universe, or (2) an ontological world (see world disclosure). In a [EDIT TEXT] context, world usually refers to the material or the profane sphere, as opposed to the celestial, spiritual, transcendent or sacred. The "end of the world" refers to scenarios of the final end of human history, often in religious contexts.


ok. Now I can post images :-) In the image below, red colored cells are edit texts. Other colored texts are textviews (sorry too much bright colors). Now, if I use leftOf/rightOf methods in RelativeLayout it will look like the second image. Am I thinking in the wrong direction ?

Answers


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)


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.


Need Your Help

Gridview Columns change on postback

asp.net vb.net gridview autogeneratecolumn

I'm developing my website in asp.net using visual web developer 2010. I have a product page for an online store where it is displaying the product pictures and a gridview is displaying information ...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.