0

So I made a listview with an: 'ArrayAdapter'. I gave the listview a style with textcolor, but it isn't working. It has nothing to do with the background, right?

Can someone tell me why this isn't working?

XML style in the folder: 'values', code:

<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="buttontext2" >
    <item name="android:layout_width" >fill_parent</item>
    <item name="android:layout_height" >wrap_content</item>
    <item name="android:textColor" >#000000</item>
    <item name="android:gravity" >center</item>
    <item name="android:layout_margin" >3dp</item>

    <item name="android:shadowColor" >#000000</item>
    <item name="android:shadowDx" >1</item>
    <item name="android:shadowDy" >1</item>
    <item name="android:shadowRadius" >2</item>
</style>
</resources>

XML background in the folder: 'drawable', code:

<?xml version="1.0" encoding="utf-8" ?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="true" >
    <shape>
      <solid
          android:color="#f0f8ff" />
      <stroke
          android:width="1dp"
          android:color="#f0f8ff" />
      <corners
          android:radius="6dp" />
      <padding
          android:left="10dp"
          android:top="10dp"
          android:right="10dp"
          android:bottom="10dp" />
    </shape>
  </item>
  <item>
    <shape>
      <gradient
          android:startColor="#f0f8ff"
          android:endColor="#f0f8df"
          android:angle="270" />
      <stroke
          android:width="1dp"
          android:color="#ffffff" />
      <corners
          android:radius="6dp" />
      <padding
          android:left="10dp"
          android:top="10dp"
          android:right="10dp"
          android:bottom="10dp" />
    </shape>
    </item>
</selector>

Listview style and background:

android:background="@drawable/rounded_blue"
style="@style/buttontext2"
Test
  • 45
  • 1
  • 7

0 Answers0