[英]Android Studio: Fixed footer that's locked to bottom
I'm currently working on a layout in Android Studio but there's a problem that I need to fix.. I want to make my layout be locked to the bottom, just like Facebook which has a layout-bar at the bottom, no matter how much you scroll, it wont move. 我目前正在Android Studio中处理布局,但有一个问题需要解决。.我想使布局锁定在底部,就像Facebook在底部具有布局栏一样,无论如何你滚动很多,它不会动。
Right now my code looks like this, but the "goButtonLayout" keeps going out of screen.. Anyone got an idea? 现在,我的代码看起来像这样,但是“ goButtonLayout”一直在屏幕外显示。有人知道吗?
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:flatui="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background"
android:orientation="vertical"
android:nestedScrollingEnabled="true"
android:paddingBottom="20dp"
android:id="@+id/content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp"
android:id="@+id/contentLayout">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:id="@+id/searchngo">
<com.cengalabs.flatui.views.FlatEditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/editBox"
android:textColor="#fff"
android:text="@+string/choose"
flatui:fl_fontWeight="bold"
flatui:fl_fieldStyle="0"
flatui:fl_blockButtonEffectHeight="3dp"
android:longClickable="false"
android:layout_marginBottom="2dp"
android:layout_gravity="left"
android:paddingRight="60dp"
android:paddingLeft="12dp"
android:paddingTop="12dp" />
<com.cengalabs.flatui.views.FlatButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
flatui:fl_touchEffect="fl_ripple"
android:text="@+string/addRow"
android:id="@+id/newRow"
flatui:fl_blockButtonEffectHeight="3dp"
android:clickable="true"
android:layout_marginLeft="16dp" />
</LinearLayout>
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/scrollView3" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:paddingBottom="24dp">
<com.cengalabs.flatui.views.FlatButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/search"
android:id="@+id/test111"
flatui:fl_touchEffect="fl_ripple"
flatui:fl_blockButtonEffectHeight="3dp"
android:clickable="true"
android:layout_marginTop="16dp" />
<com.cengalabs.flatui.views.FlatButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/search"
android:id="@+id/test666"
flatui:fl_touchEffect="fl_ripple"
flatui:fl_blockButtonEffectHeight="3dp"
android:clickable="true"
android:layout_marginTop="16dp" />
<com.cengalabs.flatui.views.FlatButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/search"
android:id="@+id/test333"
flatui:fl_touchEffect="fl_ripple"
flatui:fl_blockButtonEffectHeight="3dp"
android:clickable="true"
android:layout_marginTop="16dp" />
<com.cengalabs.flatui.views.FlatButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/search"
android:id="@+id/test6532"
flatui:fl_touchEffect="fl_ripple"
flatui:fl_blockButtonEffectHeight="3dp"
android:clickable="true"
android:layout_marginTop="16dp" />
<com.cengalabs.flatui.views.FlatButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/search"
android:id="@+id/test6123"
flatui:fl_touchEffect="fl_ripple"
flatui:fl_blockButtonEffectHeight="3dp"
android:clickable="true"
android:layout_marginTop="16dp" />
<com.cengalabs.flatui.views.FlatButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/search"
android:id="@+id/test512"
flatui:fl_touchEffect="fl_ripple"
flatui:fl_blockButtonEffectHeight="3dp"
android:clickable="true"
android:layout_marginTop="16dp" />
<com.cengalabs.flatui.views.FlatButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/search"
android:id="@+id/test123123"
flatui:fl_touchEffect="fl_ripple"
flatui:fl_blockButtonEffectHeight="3dp"
android:clickable="true"
android:layout_marginTop="16dp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/goButtonLayout">
<com.cengalabs.flatui.views.FlatButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/search"
android:id="@+id/goButton"
flatui:fl_touchEffect="fl_ripple"
flatui:fl_blockButtonEffectHeight="3dp"
android:clickable="true"/>
</LinearLayout>
Try like this better to use Relative Layout for this 最好像这样尝试使用相对布局
使用FrameLayout作为主要布局。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.