In my application, I have a FragmentActivity function that implements ListFragment.OnSelectedListener.
ListFragment uses a custom adapter that inflates the customrow.xml layout.
I would like to change the color and height of the separator in the list.
It seems to me that I need to use the android: divider property, but I don’t know how.
I tried putting it in the FragmentActivity layout and in the customrow.xml layout, but it does not work ...
customrow.xml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:background="@drawable/item_selector"
android:divider="#f19000" >
...textview and imageview...
</LinearLayout>
Edit: solution
Thank you all for your help! The problem was that I did not inflate the custom xml for my ListFragment ...
So, creating a new list_fragment.xml and adding something like this in my ListFragment did the trick:
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.list_fragment, null);
return view;
}
list_fragment.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="#f19000"
android:dividerHeight="1dip" >
</ListView>
</LinearLayout>
, android: id = "@android: id/list" , .