2013-11-28 68 views
0

我已經使用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,但視圖仍然不透明。

+0

你有沒有找到解決方案?似乎有一個拉請求:https://github.com/umano/AndroidSlidingUpPanel/pull/49 –

回答

0

我有同樣的問題,看起來好像此功能之前添加,但它沒有在代碼中。我使用了其他版本的SlidingUpPanelLayout.java (here)並將mIsTransparent更改爲true false

7

對此的支持已添加到庫中。只需將overlay屬性設置爲true,並將面板的顏色設置爲透明。

+0

如何部分拉窗格?我想只顯示底部窗格的一半。 –

+0

使用setPanelHeight() –

+0

Man..But我無法啓用覆蓋..因爲這創建了一個灰色陰影..我需要外部佈局白色和滑動面板佈局透明...請儘可能回覆,如果可能的話 –