????????今天有個需求就是在本不該有laoding的地方加個 laoding,源碼中有騰訊的QMUI,所以選用了,QMUILoadingView。
????????但是有個問題,就是即使這個View蓋在最上層,顯示出來的時候,依然可以點擊下邊的控件。
? ? ? ? 處理:在外層RelativeLayout加上獲取焦點
????android:clickable="true"android:focusable="true"可以攔截點擊事件,不傳遞到下邊的控件;如果沒有這兩句,事件就會傳遞到下層去,雖然有這上邊的一層,依然可以操作下邊的控件
<!--android:clickable="true"android:focusable="true"可以攔截點擊事件,不傳遞到下邊的控件;如果沒有這兩句,事件就會傳遞到下層去,雖然有這上邊的一層,依然可以操作下邊的控件--><RelativeLayoutandroid:id="@+id/rl_loading_view"android:layout_width="match_parent"android:visibility="gone"android:clickable="true"android:focusable="true"android:layout_height="match_parent"><com.qmuiteam.qmui.widget.QMUILoadingViewandroid:id="@+id/loading_view"android:color="@color/black"app:qmui_loading_view_size="@dimen/dp_25"android:layout_centerInParent="true"android:layout_width="wrap_content"android:layout_height="wrap_content"/></RelativeLayout>