Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set background of sliding up panel to transparent #4

Closed
Jim-Chang opened this issue Jun 21, 2013 · 10 comments
Closed

How to set background of sliding up panel to transparent #4

Jim-Chang opened this issue Jun 21, 2013 · 10 comments

Comments

@Jim-Chang
Copy link

I have tried to set android:background="#00000000 in following code.

<com.sothree.slidinguppaneldemo.SlidingUpPanelLayout
    android:id="@+id/sliding_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#00000000 >

or set the same code on the layout (for example, RelativeLayout) whitch is inner SlidingUpPanelLayout, but the background is still white.
How do I write the code to make background transparent?

@tokudu
Copy link
Contributor

tokudu commented Jun 24, 2013

You need to set the background in the views that it contains and not the in SlidingUpPanelLayout itself.

@tokudu tokudu closed this as completed Jun 24, 2013
@Tarang
Copy link

Tarang commented Aug 31, 2013

@tokudu I have tried this with the first child but only the colour changes to something more greyish, but nothing can be seen underneath. Is there anything else that needs to be done (besides alpha & background on the xml?)

@tokudu
Copy link
Contributor

tokudu commented Sep 3, 2013

Can you post your complete layout?

@blah1234
Copy link

blah1234 commented Oct 2, 2013

I'm also having this problem of not being able to set the sliding panel to be transparent. Using the demo application included in your download, I changed the background to transparent of all the child elements in the sliding panel linear layout. I would expect that the words "Main Content" to be visible through the sliding panel now. But that isn't the case. The sliding panel is still opaque white underneath the transparent child elements.

@dominicthomas
Copy link

I managed to do this by commenting out canvas.clipRect(mTmpRect); in the drawChild method and setting a ARGB (#80FFFFFF) colour to the 2nd child layout of the sliding up panel in my layout xml . The sliding up panel, was clipping the rest of the view to save unnecessarily redrawing the layout behind it.

@MarinaEariel
Copy link

@domji84 solution worked for me too. I'm using a gradient drawable as background. It's doesn't look like the commented line broke anything.

@sud007
Copy link

sud007 commented Jun 10, 2015

@dominicthomas worked for me as well but I can see some black color behind!

@DinhPhucTran
Copy link

You need to set umanoOverlay="true" to make sliding panel overlay main content.

@maximPetlyuk
Copy link

@dominicthomas, also worked for me. Thanks. But how can we add umanoFadeColor to all the first child, because when we make sliding layout transparent, part of the first child is under the umanoFadeColor attribute, and some part is not.

@GarvitKushwaha
Copy link

@DinhPhucTran thanks bro..i just stucked from 3 days to resolve that bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants