Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the default color of a ListView divider line?

Currently I am using this code to see the divider lines:

medalsList.setDivider(new ColorDrawable(0x99F10529)); medalsList.setDividerHeight(1); 

What is the default RGB color (as shown in the code above) used on a ListView that hasn't had its divider lines changed?

like image 871
Ethan Allen Avatar asked Aug 03 '12 01:08

Ethan Allen


2 Answers

The default divider is determined by the listDivider item in the current theme. For the stock themes, the default divider is one of:

  • android:drawable/divider_horizontal_dark (Theme)
  • android:drawable/divider_horizontal_bright (Theme.Light)
  • android:drawable/divider_horizontal_holo_dark (Theme.Holo)
  • android:drawable/divider_horizontal_holo_light (Theme.Holo.Light)

Those drawables can be found in the platforms data folder of your sdk installation.

like image 151
Ted Hopp Avatar answered Oct 17 '22 06:10

Ted Hopp


You can use:

<View   android:layout_width="match_parent"   android:layout_height="wrap_content"   android:background="?android:attr/listDivider" /> 

Refer: How can I get the default divider?

P.S. Posting it here because Google search seems to land first on this thread instead of the other one.

like image 20
Gaurav Kumar Gupta Avatar answered Oct 17 '22 06:10

Gaurav Kumar Gupta