Try setting the width on the li_cht_text TextView to fill_parent.

On Feb 3, 4:53 pm, Selmi <se...@centrum.sk> wrote:
> thanks a lot, i knew i had to do something stupid. this helped
> partially, now text turns to black and is readable when focused
>
> but it didn't solved 2nd problem - when i make my own adapter and then
> click on item then there is not orange flash on it. instead text
> temporarily changes color to black (becomes unreadable because of
> black background). i guess i must set something special for its
> TextView to make it work? just for curiosity i went through listview
> apidemos, especially List4, but didn't found anything special to
> enable/disable
>
> my listview definition now looks like this:
>
>         <ListView
>                 android:id="@android:id/list"
>         android:layout_width="fill_parent"
>         android:layout_height="0px"
>         android:layout_weight="1"
>                 android:drawSelectorOnTop="false"
>     />
>
> and its items:
>
> <?xml version="1.0" encoding="utf-8"?>
> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/
> android"
>     android:layout_width="fill_parent"
>     android:layout_height="wrap_content"
>     >
>         <LinearLayout
>         android:layout_width="fill_parent"
>             android:layout_height="wrap_content"
>             android:orientation="horizontal"
>                 >
>                 <CheckBox
>                         android:id="@+id/li_cht_checkbox"
>                         android:layout_width="wrap_content"
>                         android:layout_height="wrap_content"
>                         android:layout_weight="0"
>                         />
>                 <TextView
>                         android:id="@+id/li_cht_text"
>                         android:layout_width="0px"
>                         android:layout_height="wrap_content"
>                         android:layout_weight="1"
>                         android:singleLine="true"
>                         
> android:textAppearance="?android:attr/textAppearanceLarge"
>                         />
>         </LinearLayout>
> </RelativeLayout>
>
> On 4. Feb, 00:34 h., Romain Guy <romain...@google.com> wrote:
>
> > Make sure you haven't set the selector to be drawn on top of the list items.
>
> > On Tue, Feb 3, 2009 at 3:31 PM, Selmi <se...@centrum.sk> wrote:
>
> > > hi
>
> > > its probably extremely stupid question, but i can't move with it and
> > > when i searched i didn't found anything relevant...
>
> > > problem:
>
> > > if you look to any listview api demos from samples you will see that
> > > 1) when orange focus is over any item in list then its text changes to
> > > black automatically
> > > 2) when you click on any item it flashes with orange
>
> > > if you look to these listview api demos you will see there is no
> > > additional code, just setting of adapter and some data.
>
> > > but when i use SimpleCursorAdapter  with
> > > android.R.layout.simple_list_item_1 in my application then if i scroll
> > > list then this orange overlay hides text under it...all i see is
> > > orange rectangle. why text under it doesn't change to black????
>
> > > and if i use my own ListAdapter based on SimpleCursorAdapter then i
> > > will not get this orange flash when item is clicked on.
>
> > > why???? i have no idea what is wrong, how come that code copied from
> > > api demo to my code starts to behave differently? in xml file i don't
> > > have anything special set for listview, just its dimensions are not
> > > fill_parent but based on weight=1.
>
> > --
> > 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 Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to