BTW, due to the way messages are formatted when sent to this group, the part where the letters go down in a column should have a bunch of spaces in front of them so they're lined up with the a at the end of the first line (i.e. they are all against the right edge of the screen).
On Mar 30, 4:58 pm, Stormtap Studios <r...@stormtapstudios.com> wrote: > Hi guys, > > I'm trying to build a custom TextView solution. I want to be able to > create text views with some "tagged" text, e.g. "<i>This text is > italic</i><b>and this text is bold</b>", and since you can only set > one style for all the text in the textview I need to come up with > something custom. I've written a class that will parse the string and > generate an array of pairs (text paired with style to apply to the > text). > > What I am trying to figure out is how to get a series of TextView > objects arranged on the screen such that they wrap around the width of > their container. > > I tried this: > > <LinearLayout > xmlns:android="http://schemas.android.com/apk/res/android" > android:layout_width="fill_parent" > android:layout_height="fill_parent" > android:orientation="horizontal" > android:id="@+id/TestLayout"> > </LinearLayout> > > And then I tried having my class take a LinearLayout object, and add > TextView objects to it, one for each pair (with the styles applied to > each individual TextView object). This doesn't work. The content > doesn't wrap to a new line when it hits the edge of the screen. So > for example for this string: "<i>This is a long italic string.</i> > and this is normal text <b>and this is bold</b>", the output looks > like this: > > This is a long italic string, and this is normal text, a > > n > > d > > t > > h > > i > > s > > i > > s > > b > > o > > l > > d > > Whereas I would like it to look like this: > > This is a long italic string, and this is normal text, > and this is bold > > I've tried all kinds of combinations for layout settings to try to get > it to work, and haven't had any luck. Does anyone have any advice for > how I might get the labels to wrap nicely? > > I've been thinking that instead I could just use a WebView, and pass > it the text to render, but I am worried about the overhead and speed > of doing this. These custom labels will appear in a fullscreen > ListView with many rows. I'm worried having a webview in each row for > a large set would be extremely slow. > > Thanks in advance for reading and any advice, > > Rob -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en To unsubscribe, reply using "remove me" as the subject.