san*_*one 1 android scrollview android-layout
屏幕中心(内容区域)被占用时,屏幕上有页眉和页脚ScrollView
.当我启动应用程序时,会显示页脚.但是,当我点击元素"A"时,它会在屏幕上显示更多元素,推动下面的其他元素.所述ScrollView
确实使中央部滚动的,但它也隐藏页脚(灰色LinearLayout
在屏幕的底部).
如何在页面底部留下页脚?我希望Content Area只滚动.页眉和页脚XML不在ScrollView
元素之内.我尝试使用RelativeLayout
页脚而不是LinearLayout
,但没有任何成功.
这是单击元素"A"之前和之后的外观.
如果需要,我可以提供代码,XML和Java,但它几乎是代码.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:fillViewport="true">
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</LinearLayout>
</ScrollView>
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
</LinearLayout>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
使用重量进行布局