0

I have a very basic widget with two buttons in a layout. They look like standard android buttons, but with the 4.4 update the buttons now appear as a dark grey instead of light grey. They remain normal in previous versions of android. Does anyone have any idea of why this is happening and how I can fix this? Thanks!

Button xml:

<Button
            android:id="@+id/button_widget_newshift"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_weight="1"
            android:text="@string/new_shift_split"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:textColor="#101010"
            android:textSize="@dimen/widget_text" />
u2tall
  • 450
  • 1
  • 7
  • 12

1 Answers1

1

I don't have an answer (and I don't have enough of a reputation to post a comment). I have the same problem, although I'm creating my buttons in code. They work on devices prior to 4.4, but are dark grey and borderless on my Nexus with 4.4 and a 4.4 emulator.

I understand that 4.4 changed drawables to tone down touch feedback (see http://developer.android.com/design/patterns/new.html). Perhaps, in the process, a button style or drawable got misplaced. If so, a solution/kludge might be to copy working resources from the SDK into your project and call setBackgroundResource() to them. I haven't tried this; I'm hoping someone can come up with something more elegant and definitive.

Peter McLennan
  • 371
  • 4
  • 11
  • I might have sussed it! In values-v14/styles.xml, I changed android:Theme.Holo to android:Theme.Holo.Light, and the button faces and borders came back! Dunno why; doesn't seem right/necessary, but it seems to have worked for me. Whether this solution is workable for you depends on the style you're after, I guess. – Peter McLennan Jan 13 '14 at 21:33