1

我正在尝试使用 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">

在此处输入图像描述

在此处输入图像描述

你们中的任何一个,你有没有成功地做到这一点?

4

1 回答 1

5

您可以将淡入淡出颜色设置为透明:

SlidingPaneLayout sp = (SlidingPaneLayout) findViewById(R.id.mainSlider);
sp.setSliderFadeColor(getResources().getColor(android.R.color.transparent));
于 2015-01-01T21:05:12.663 回答