gpt4 book ai didi

Android SlidingPaneLayout 淡入淡出

转载 作者:行者123 更新时间:2023-11-29 15:56:22 26 4
gpt4 key购买 nike

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

enter image description here

enter image description here

你们中的任何一个,你曾经成功地做到过吗?

最佳答案

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

SlidingPaneLayout sp = (SlidingPaneLayout) findViewById(R.id.mainSlider);
sp.setSliderFadeColor(getResources().getColor(android.R.color.transparent));

关于Android SlidingPaneLayout 淡入淡出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27734594/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com