简体   繁体   English

Android Studio:固定页脚固定在底部

[英]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.

相关问题 Android页脚固定在底部,将坐在其他视图之上 - Android Footer Fixed On Bottom And Will Sit On Top Of Other Views Android Sticky-footer:将页脚视图与表格对齐,直到达到屏幕大小,然后固定在底部 - Android sticky-footer: Align footer view to table, until it reaches screen size, then become fixed.at the bottom 在Android布局中固定页脚 - Fixed footer in android layout 页脚在android中的viewpager上修复 - footer is fixed on viewpager in android Android RecyclerView固定页脚 - Android RecyclerView Fixed Footer Android在翻译Y时保持视图底部固定 - Android Keep view's bottom fixed while translating it's Y 具有固定页眉和页脚的“活动”底部带有按钮的ListView - ListView with button at the bottom in Activity with fixed header and footer 列表视图下方的页脚固定在屏幕底部 - Footer below list view fixed at the bottom of the screen Android 粘性 - 使用 jetpack 组合的页脚:将页脚视图与表格对齐,直到达到屏幕大小,然后固定在底部 - Android sticky - footer using jetpack compose: Align footer view to table, until it reaches screen size and then become fixed at the bottom 底部的Android固定标签 - Android Fixed Tab at Bottom
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM