【发布时间】:2011-08-03 15:29:33
【问题描述】:
当列表为空时,我想使用setEmptyView() 方法将下面这样的Button 添加到我的ListView 中。
Android 中是否为此提供了内置样式?因为我注意到一些应用程序使用完全相同的Button 样式。
【问题讨论】:
-
那是自定义按钮,标准界面不提供该样式。
当列表为空时,我想使用setEmptyView() 方法将下面这样的Button 添加到我的ListView 中。
Android 中是否为此提供了内置样式?因为我注意到一些应用程序使用完全相同的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" />
【讨论】:
简答:不,这不是标准的Button。
但是,您可以使用ImageView 添加类似的Button。你只需要设计/下载你喜欢的东西。
【讨论】: