[英]Android Studio: Fixed footer that's locked to bottom
我目前正在Android Studio中處理布局,但有一個問題需要解決。.我想使布局鎖定在底部,就像Facebook在底部具有布局欄一樣,無論如何你滾動很多,它不會動。
現在,我的代碼看起來像這樣,但是“ 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>
最好像這樣嘗試使用相對布局
使用FrameLayout作為主要布局。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.