I'm using a custom list item subclassed from a RelativeLayout, but the 
layout seems to be ignoring the background colour:

 my class looks like this:

public class MyListItem extends RelativeLayout {

        public MyListItem(Context context) {

super(context);

}


 public MyListItem(Context context, AttributeSet attrs) {

super(context, attrs);

}


 public MyListItem(Context context, AttributeSet attrs, int defStyle) {

super(context, attrs, defStyle);

}


        public void bindViewInit(MessageList.MessageListAdapter adapter,

boolean allowBatch) {

... capture values to work with touch events in the list item ....

}

        

        public boolean onTouchEvent(MotionEvent event) {

                ... handle touch events on child components ... 

        }

}


My layout looks like this:


<mypackage.MyListItem

    xmlns:android="http://schemas.android.com/apk/res/android";

    android:layout_width="match_parent"

    android:layout_height="?android:attr/listPreferredItemHeight"

    android:paddingRight="10dip"

    android:background="@android:color/white">

   .... other components ...

</mypackage.MyListItem>



The problem is that MyListItem seems to be ignoring the background colour 
attribute set in the layout. I've also tried setting the background colour 
on the list view that contains the list item with no luck.


Does anyone have any idea whats going on here?


-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to