我已經使用Umano代碼創建了一個滑動佈局: https://github.com/umano/AndroidSlidingUpPanel與Umano SlidingUpPanel透明面板
它完美,但我有一個問題。我的面板應該部分透明,所以原始視圖在啓動時仍然可見。
視圖背景設置正確#64000000,但它仍然是完全不透明的,沒有任何可以看到它背後。
下面的代碼:
<com.sothree.slidinguppanel.SlidingUpPanelLayout
android:id="@+id/sliding_up_panel"
android:layout_height="match_parent"
android:layout_width="match_parent">
<ImageView
android:layout_height="match_parent"
android:layout_width="match_parent"
android:scaleType="fitCenter"
android:id="@+id/images_gallery_image" />
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:background="#64000000">
<!-- MY STUFF (transparent stuff) -->
</RelativeLayout>
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
我想,也許這個問題是通過隱藏的擴展面板下方的UI元素引起的,所以我試圖在庫中的代碼打轉轉,但它似乎沒有不相關。
在調試時,我注意到庫355行中的hasOpaqueBackground(View v)確實返回false,但視圖仍然不透明。
你有沒有找到解決方案?似乎有一個拉請求:https://github.com/umano/AndroidSlidingUpPanel/pull/49 –