2011-12-08 20 views
0

私のプログラムはレイアウト1とレイアウト2の2つのレイアウトを持っていました。 layout1がOnTouchListener()によってタッチされている間に、layout2を表示させます。 layot1の上にlayout2が必要です。 これに対して、layout2はlayout1によって上書きされます。 誰でも問題を解決するのに役立ちますか? 私のコードのように:私はrelativeLayout2がvideoView1を上書きしたいAndroidのレイアウトの優先度

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/RelativeLayout1" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" > 

    <RelativeLayout 
     android:id="@+id/relativeLayout2" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:visibility="invisible"> 


     <ImageButton 
      android:id="@+id/video_playback_pause" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content"/> 

    </RelativeLayout> 

    <VideoView 
     android:id="@+id/videoView1" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:layout_centerInParent="true"/> 

     android:layout_alignParentLeft="true" 
     android:layout_alignParentBottom="true" android:layout_below="@id/relativeLayout2"/> 

</RelativeLayout> 

+0

コード/ XMLサンプルを入力してください。 –

答えて

1

FrameLayoutを使ってViewのスタックを作成することもできます。また、ViewFlipperを見ることもできます。レイアウトをフラグメントにして配置することができれば、必要に応じて最適なレイアウトを選択できます。