作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 SlidingPaneLayout 制作原型(prototype)应用。我的 SlidingPaneLayout 是灰色的,正文 View 是纯白色的。但是当我滑入时,正文页面的小可见区域会稍微变暗或覆盖有深色屏幕。我想要的只是那个 body View 的纯原始白色。
我尝试了几种方法来关闭它们,但似乎不可能。比如
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">
你们中的任何一个,你曾经成功地做到过吗?
最佳答案
您可以将淡入淡出颜色设置为透明:
SlidingPaneLayout sp = (SlidingPaneLayout) findViewById(R.id.mainSlider);
sp.setSliderFadeColor(getResources().getColor(android.R.color.transparent));
关于Android SlidingPaneLayout 淡入淡出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27734594/
我是一名优秀的程序员,十分优秀!