Is there a way to bring an imageView to the front of another imageView which is in a linearLayout? 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
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
. 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中,然后将图像放在其上方怎么办?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.