2011-08-10 49 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

不完全确定你的意思?我是否将专辑封面的可见性改回可见吗?如果是这样,是的。如果有其他我需要改变的东西,不。 –

相关问题