亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Android Margin 和 Padding 不適用于 ScrollViews 中的

Android Margin 和 Padding 不適用于 ScrollViews 中的

慕哥9229398 2021-06-07 08:39:57
當我把一個RecyclerView作為滾動型的孩子,marginBottom并paddingBottom沒有工作。為父級設置這些值LinearLayout也不會影響任何事情。似乎ScrollView沒有滾動到底部,因為ScrollBar沒有到達底部。我該如何修復這個錯誤?<LinearLayout android:layout_width="match_parent"android:layout_height="match_parent"xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"android:orientation="vertical"><!--To avoid scroll view from scrolling to the bottom automatically--><View android:layout_width="match_parent" android:id="@+id/focus_view" android:layout_height="0dp" android:focusable="true" android:focusableInTouchMode="true"><requestFocus/></View><ScrollView    android:id="@+id/sv_categories_statistics"    android:layout_width="match_parent"    android:layout_height="0dp"    android:layout_weight="10">    <LinearLayout        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:orientation="vertical"        android:layout_margin="4dp">        <LinearLayout            android:id="@+id/ll_categories_statistics_filters_container"            android:layout_width="match_parent"            android:layout_height="wrap_content"            android:layout_marginStart="4dp"            android:layout_marginTop="4dp"            android:layout_marginEnd="4dp">            <LinearLayout                android:id="@+id/ll_categories_statistics_select_date_fragment_container"                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:orientation="vertical"                android:background="@drawable/border_primary_light"                android:padding="4dp"                android:layout_marginEnd="4dp"/>            </LinearLayout>        </LinearLayout>    </LinearLayout></ScrollView>
查看完整描述

1 回答

?
12345678_0001

TA貢獻1802條經驗 獲得超5個贊

你有沒有嘗試過 clipToPadding


 <android.support.v7.widget.RecyclerView

            android:id="@+id/rv_categories_statistics"

            android:layout_width="match_parent"

            android:layout_height="wrap_content"

            android:paddingBottom="50dp"

            android:clipToPadding="false"/>


查看完整回答
反對 回復 2021-06-10
  • 1 回答
  • 0 關注
  • 269 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號