如果列表为空,使用setEmptyView()
方法,我想添加一个如下所示的Button
到我的ListView
中。如何在ListView的emptyView顶部添加“加号”按钮
这是Android内置风格吗?因为我注意到一些应用程序使用完全相同的风格。
如果列表为空,使用setEmptyView()
方法,我想添加一个如下所示的Button
到我的ListView
中。如何在ListView的emptyView顶部添加“加号”按钮
这是Android内置风格吗?因为我注意到一些应用程序使用完全相同的风格。
简答:不,这不是标准Button
。
但是,您可以使用ImageView
添加类似的Button
。你只需要设计/下载你喜欢的东西。
看看这个链接:Add Items to ListView - Android
它显示了正确的Android资源的使用,这表明在ImageButton的一个绿色的“+”符号。
准确地说:
<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" />
这是一个自定义按钮,标准接口,并没有提供这种风格。 – 2011-08-03 15:43:49