Hide view behind another view in Android

[亡魂溺海] 提交于 2020-01-02 03:15:07

问题


I'm trying to get a view to "slide behind" another view. Consider a set of cards as an example: if I put card A behind card B, card A is still there but it is being blocked because card B is OVER or IN-FRONT-OF card A.

I am well aware of setInvisibilty() but that is not the effect I'm looking for.

I have an animation that animates a Google-Now-card-like view onto the screen. The card passes over some text that is shown in front of the card (whereas I want the card to slide above the text) during the animation. I have an alpha animation on the text which does not help as it's already pretty solid by the time the card passes over.

Any response to the problem above or suggestions for a different method are highly appreciated.


回答1:


See this previous question : Defining Z order of views of RelativeLayout in Android

View.bringToFront()

Is what you're looking for.



来源:https://stackoverflow.com/questions/27623741/hide-view-behind-another-view-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!