2011-08-10 23 views
0

我無法弄清楚如何在組內隱藏某些圖片,我目前使用的這組設置如何讓圖像隱藏並隨專輯封面再次顯示? Android的XML

<RelativeLayout android:layout_width="88.0px" android:layout_height="95.0px" > 
    <ImageView android:layout_width="67.0px" android:layout_height="75.0px" android:src="@drawable/coverart" android:layout_marginLeft="16.0px" android:layout_marginTop="10.0px" android:scaleType="fitXY" /> 
    <ImageButton android:id="@id/albumArt" android:visibility="gone" android:layout_width="67.0px" android:layout_height="75.0px" android:layout_marginLeft="16.0px" android:layout_marginTop="10.0px" android:scaleType="fitXY" android:adjustViewBounds="true" /> 
    <ImageView android:layout_width="88.0px" android:layout_height="95.0px" android:src="@drawable/peel" android:scaleType="fitXY" /> 
</RelativeLayout> 

現在暫停時這個隱藏專輯封面,但我無法弄清楚如何隱藏疊加層。我所嘗試的一切只是不斷隱藏整個團隊。我知道必須有一種方法來隱藏整個組合,然後像專輯封面那樣重新播放。

任何幫助將是偉大的,謝謝。

+0

使用的FrameLayout做完整的操作....更好的你忽略的靜態值.. – Hanry

回答

0

爲什麼不嘗試隱藏整個佈局而不是隱藏元素。在暫停時隱藏佈局,並在需要時將其恢復。

<RelativeLayout android:layout_width="88.0px" android:layout_height="95.0px" android:visibility="gone"> 
<ImageView android:layout_width="67.0px" android:layout_height="75.0px" android:src="@drawable/coverart" android:layout_marginLeft="16.0px" android:layout_marginTop="10.0px" android:scaleType="fitXY" /> 
<ImageButton android:id="@id/albumArt" android:layout_width="67.0px" android:layout_height="75.0px" android:layout_marginLeft="16.0px" android:layout_marginTop="10.0px" android:scaleType="fitXY" android:adjustViewBounds="true" /> 
<ImageView android:layout_width="88.0px" android:layout_height="95.0px" android:src="@drawable/peel" android:scaleType="fitXY" /> 

+0

我試過了,但整體佈局保持隱藏和播放不會出現:(這是我試過的第一件東西 –

+0

所以再次回放時,你必須將它的可見性從「逝去」改變爲「可見」。你是否這樣做 –

+0

不完全確定你的意思?我是否將專輯封面的可見性改回可見嗎?如果是這樣,是的。如果有其他我需要改變的東西,不。 –

相關問題