我一直浏览不同的帖子,他们都有脚注试图留在屏幕上。Android - 如何添加一个简单的页脚?
但我希望页脚出现在每一页上。我的一些页面没有滚动条,但有些可以。每当有滚动时,我都希望页脚出现在滚动条下方。如何做到这一点?
举例来说,如果我有这个页面:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:id="@+id/page_exlain"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Some text that either extends far down or is pretty short."
android:layout_marginTop ="20dp"
/>
</LinearLayout>
</ScrollView>
</LinearLayout>
什么是页脚补充一点,不一定出现倍以上的好办法?
谢谢!
+1 ...根据您的应用程序结构,我喜欢将所有这些内容抽象为基本活动,并创建受保护的方法以将内容添加到通用“基本”布局文件。这样,所有将来的活动都可以像setContentView()那样轻松填充。 – Phix