I got it the marquee TextView working after all ! A bit of a mystery about the combination of attributes that works so maybe I am relying on undocumented behavior.
For some reason adding android:focusableInTouchMode="true" causes the marquee to activate. Why is that? android:focusable="true" is required for the marquee to work. But it won't start scrolling until you navigate with the down arrow key to the marquee view. With focusableInTouchMode it also starts scrolling initially (which is what I wanted). Not sure why that view initially has focus. There are two buttons in a RelativeLayout above this view. Why does this text marquee start scrolling and get focus initially? Here is what works: <TextView android:id="@+id/WantaMarqueeText" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:paddingLeft="4dp" android:paddingRight="4dp" android:singleLine="true" android:ellipsize="marquee" android:focusable="true" android:focusableInTouchMode="true" android:text="Blah blah blah on and on we go andlongwordandmore" ></TextView> Adding the <requestFocus> element child to the TextView or any other view doesn't seem to do anything. On Feb 6, 11:48 am, jotobjects <jotobje...@gmail.com> wrote: > Tried to post this the last two days (hopefully problem with this list > is now resolved). > > I haven't given up on figuring out how to display a single line of > text that is wider than the view. More observations and questions: > > (1) ellipsize="marquee" is not allowed for EditText (generates > exception). > > (2) ellipsize="marquee" doesn't do anything for TextView. Seems to > just truncate text even with focus. Is there a trick to make this > work? > > (3) scrollHorizontally="true" which is a documented attribute for > TextView actually only applies to EditText. Is this a documentation > bug? > > On Feb 2, 9:40 am, jotobjects <jotobje...@gmail.com> wrote: > > > Actually I have tried both marquee and scrollHorizontally. There was > > a previous topic that I responded to a couple of days ago with the > > marquee layout code (that also doesn't work). > > >http://groups.google.com/group/android-developers/msg/5f466bd386877029 > > > I was suspecting that some of the TextView attributes are only valid > > for EditText views. Is that right - and if so how do you know which > > TextView attributes are only valid for EditText views? > > > This seems pretty basic - how to use a wide line of text on a small > > screen device. What are good ways to deal with this use case? > > > On Feb 1, 5:31 pm, Romain Guy <romain...@android.com> wrote: > > > > scrollHorizontally enables user scrolling for editable text fields. If > > > you want automatic scrolling, use android:ellipsis="marquee" > > > > On Mon, Feb 1, 2010 at 3:11 PM, jotobjects <jotobje...@gmail.com> wrote: > > > > Is there a way to put a single line of static text into a TextView and > > > > allow the user to scroll over the part that is not initially visible? > > > > I have tried scrollHorizontally, but I get text that > > > > is truncated. This is the layout (that doesn't scroll). > > > > > <TextView > > > > android:id="@+id/wanttoscrollt" > > > > android:layout_width="fill_parent" > > > > android:layout_height="wrap_content" > > > > android:singleLine="true" > > > > android:ellipsize="end" > > > > android:scrollHorizontally="true" > > > > android:text="Blah blah andlongwordandmore" > > > > ></TextView> > > > > > I tried setting <requestFocus/> in the layout and also tried calling > > > > requestFocus() in onCreate(). > > > > > -- > > > > You received this message because you are subscribed to the Google > > > > Groups "Android Developers" group. > > > > To post to this group, send email to android-developers@googlegroups.com > > > > To unsubscribe from this group, send email to > > > > android-developers+unsubscr...@googlegroups.com > > > > For more options, visit this group at > > > >http://groups.google.com/group/android-developers?hl=en > > > > -- > > > Romain Guy > > > Android framework engineer > > > romain...@android.com > > > > Note: please don't send private questions to me, as I don't have time > > > to provide private support. All such questions should be posted on > > > public forums, where I and others can see and answer them -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en