【发布时间】:2015-05-03 11:28:29
【问题描述】:
我想用一个增加下降按钮来制作 listView:
我尝试实现这一点:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:background="#214075"
android:layout_height="match_parent"
android:orientation="vertical" >
<ListView
android:id="@+id/listbascet"
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1" />
<Button
android:id="@+id/sendtoEmail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
android:text="Заказать услуги" />
</LinearLayout>
【问题讨论】:
-
所以你想向列表视图添加元素?
-
你从 xml 得到什么结果?在这种情况下,我建议使用 RelativeLayout。使用 android:layout_below="@+id/your_list_view_id" 确保 Button 位于 Listview 下方。并且你将 ListView 的 layout_height 设置为 0dip,这意味着你不想显示它?我想你想把它设置为 wrap_content
-
内嵌图片,删除了问候语。
-
@xwhyLikeThis 它的结果是我的 xml s22.postimg.org/ygpo9g169/image.png
-
@SebastianWalla 是的,我想将元素添加到 listView,然后按钮向下
标签: android xml listview android-styles