[英]How to bring view to the front in linearLayout
Is there a way to bring an imageView to the front of another imageView which is in a linearLayout? 有没有办法将imageView带到linearLayout中另一个imageView的前面? I try to place a little ball image in front of image and it does'nt work because the image is in a linearLayout :( Is there any way to make it possible?
我尝试在图像前面放置一个小球图像,但它不起作用,因为图像位于linearLayout :(有什么方法可以实现吗?
<LinearLayout
android:id="@+id/HolesPlayer1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/tvGoolot13"
android:layout_centerHorizontal="true" >
<ImageButton
android:id="@+id/imgBtn0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:background="@android:color/transparent"
android:src="@drawable/hole0" />
<ImageButton
android:id="@+id/imgBtn1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:background="@android:color/transparent"
android:src="@drawable/hole0" />
<ImageButton
android:id="@+id/imgBtn2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:background="@android:color/transparent"
android:src="@drawable/hole0" />
<ImageButton
android:id="@+id/imgBtn3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:background="@android:color/transparent"
android:src="@drawable/hole0" />
<ImageButton
android:id="@+id/imgBtn4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:background="@android:color/transparent"
android:src="@drawable/hole0" />
<ImageButton
android:id="@+id/imgBtn5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:background="@android:color/transparent"
android:src="@drawable/hole0" />
</LinearLayout>
In your case I would use FrameLayout
. 在您的情况下,我将使用
FrameLayout
。 One of it's purposes is ability to stack items on each other. 其目的之一是能够将项目彼此堆叠。 Just google it and you will find plenty of tutorials.
只是谷歌它,你会发现很多教程。
将您的LinearLayout包裹在FrameLayout或RelativeLayout中,然后将图像放在其上方怎么办?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.