3

我正在使用SlidingPaneLayout 并希望在滑块右窗格打开时在左窗格上设置灰色淡化颜色,并在右窗格关闭且左窗格完全可见时在左窗格上设置透明淡化颜色。
我知道这是 的默认行为 SlidingPaneLayout,但是在默认实现的情况下,我在横向模式下遇到了问题,其中我的滑块左窗格始终保持褪色并且即使右幻灯片关闭也不会发生点击事件。
我实现SlidingPaneLayout.SimplePanelSlideListener并管理了淡入淡出的颜色onPanelOpened()onPanelClosed() 但我不确定我应该为此使用哪个功能......setCoveredFadeColor()还是 setSliderFadeColor()
这两个功能之间的确切区别是什么?

任何帮助深表感谢。谢谢!

4

1 回答 1

3

From the docs:

setSliderFadeColor(int color) Set the color used to fade the pane covered by the sliding pane out when the pane will become fully covered in the closed state.

setCoveredFadeColor(int color) Set the color used to fade the sliding pane out when it is slid most of the way offscreen.

In my experience, I've found that the panel that gets covered needs to be at least 320dp wide for these two fade colours to work.

于 2014-04-30T21:14:03.023 回答