是否可以在Android中将一个视图放置在另一个视图上?

是否可以在Android中将一个视图放置在另一个视图上?

问题描述:

我们可以将一个小视图放在另一个大视图上吗?例如,我有一个VideoView,它在后台播放文件.在此之上,在中间/角落的某个地方,我想放置另一个ImageView.

Can we place a small view over another large view? For example, I have a VideoView which is playing a file in the background. Over this, somewhere in the middle/corner, I want to place another ImageView.

但是在线性/相对布局中,视图只能一个接一个地放置或彼此相对放置,因此建议不要使用AbsoluteLayout.那我该怎么办?

But in Linear/Relative Layout, views can be placed only one after another or relative to each other, and AbsoluteLayout is advised against. So what do I do?

FrameLayouts让您将每个视图堆放在下面的视图之上.这也可以通过RelativeLayout来实现.

FrameLayouts let you pile each view on top of the one below. This can also be achieved with a RelativeLayout.