滚动背景而前景物体停留在静态的android [英] scroll background while foreground objects stay static in android
问题描述
我滚动自定义视图
。它的运作良好。
我希望能够在该视图的前景添加一个
。非常重要的是,我想在水平的LinearLayout
的LinearLayout
为自定义视图滚动保持静态
。
I want to be able to add a horizontal LinearLayout
in the foreground of that view
. Very importantly, I want the LinearLayout
to stay static as the custom view is scrolled
.
所以基本上,我会怎么做呢?通常情况下,当我有前景看法,那一刻我点击的背景下,前景消失
(我通常使用对话框
为前景
)
So basically, how would I do that? Normally, when I have a foreground view, the moment I click the background, the foreground disappears
(I usually use Dialog
for the foreground
)
推荐答案
包装在的FrameLayout
或 RelativeLayout的
。确保你的前景目标是在布局中的最后一个项目,所以它作为一个覆盖。
Wrap everything in a FrameLayout
or a RelativeLayout
. Make sure your foreground object is the last item in the layout so it acts as an overlay.
这篇关于滚动背景而前景物体停留在静态的android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!