我正在用SlidingPaneLayout试用一个原型应用程序。我的SlidingPaneLayout是灰色的,身体的视图是纯白色的。但是当我滑进去的时候,身体页面上的小可见区域会稍微变暗或者覆盖在黑暗的屏幕上。我只想要纯原始的白色的身体视图。
我尝试了几种方法关闭这些,但似乎是不可能的。比如
SlidingPaneLayout sp = (SlidingPaneLayout) findViewById(R.id.mainSlider);
sp.setHorizontalFadingEdgeEnabled(false);或跟随XML中的属性
<android.support.v4.widget.SlidingPaneLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/mainSlider"
android:requiresFadingEdge="none" <!-- try one -->
android:fadingEdgeLength="0dp" <!-- try two -->
android:fadingEdge="none" <!-- try three -->
tools:context=".MainActivity">


你们中有谁成功过吗?
发布于 2015-01-01 21:05:12
您可以将淡出颜色设置为透明:
SlidingPaneLayout sp = (SlidingPaneLayout) findViewById(R.id.mainSlider);
sp.setSliderFadeColor(getResources().getColor(android.R.color.transparent));https://stackoverflow.com/questions/27734594
复制相似问题