我正在使用以下代码在活动底部显示按钮。
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
>
<Button android:id="@+id/btnGetMoreResults"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="Get more"
/>
</RelativeLayout>
和上面的列表视图。当我在列表视图中显示更多数据时,此按钮面板向下移动。任何人都可以指导我如何在活动底部修复它吗?
任何帮助,将不胜感激。
选择正确的答案是错误的,该按钮将隐藏列表视图的下部。正确的方法是先声明按钮,并将列表放置在按钮上方。
<Button android:id="@+id/btnGetMoreResults"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="Get more"
android:layout_alignParentBottom="true"/>
<ListView
...
android:layout_above="@id/btnGetMoreResults"/>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)