簡體   English   中英

如何在linearLayout中將視圖帶到最前面

[英]How to bring view to the front in linearLayout

有沒有辦法將imageView帶到linearLayout中另一個imageView的前面? 我嘗試在圖像前面放置一個小球圖像,但它不起作用,因為圖像位於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>

在您的情況下,我將使用FrameLayout 其目的之一是能夠將項目彼此堆疊。 只是谷歌它,你會發現很多教程。

將您的LinearLayout包裹在FrameLayout或RelativeLayout中,然后將圖像放在其上方怎么辦?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM