1

I'd like to add a Button like this one below into my ListView when the list is empty using the setEmptyView() method.

Is there a built-in style in Android for this? Because I noticed that a few apps are using exactly the same Button style.

Willi Mentzel
  • 27,862
  • 20
  • 113
  • 121
milous
  • 213
  • 2
  • 5
  • 14
  • That is a custom button, standard interface does not provide that style. –  Aug 03 '11 at 15:43

2 Answers2

6

Look at this link: Add Items to ListView - Android

It shows the correct Android resource to use, which shows a green "+" symbol on the ImageButton.

To be precise:

<ImageButton
    android:id="@+id/moreImageButton"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"

    android:layout_alignParentBottom="true"
    android:layout_alignParentRight="true"

    android:contentDescription="@string/image_button_delete"
    android:src="@android:drawable/ic_input_add" />
Community
  • 1
  • 1
cs94njw
  • 535
  • 5
  • 12
3

Short answer: No, this is not a standard Button.

However, you can add a similar Button by using an ImageView. You just have to design/download something you like.

jenzz
  • 7,239
  • 6
  • 49
  • 69
Jolanda Verhoef
  • 609
  • 5
  • 11