2013-03-04 2 views
0

У меня есть WebView и SlidingDrawer, которые, когда openend открывается через WebView или, по крайней мере, это идея. Сдвижная рукоятка выдвижного ящика и содержимое отображаются вверху и ниже WebView, но не поверх WebView, что означает, что содержимое WebView видимо вместо содержимого SlidingDrawer.Содержимое SlidingDrawer, охватываемое WebView

<RelativeLayout xmlns:d1p1="http://schemas.android.com/apk/res/android" 
    d1p1:minWidth="25px" 
    d1p1:minHeight="25px" 
    d1p1:layout_width="fill_parent" 
    d1p1:layout_height="fill_parent" 
    d1p1:id="@+id/relativeLayout2" 
    d1p1:paddingTop="10dp" 
    d1p1:paddingRight="10dp" 
    d1p1:paddingLeft="10dp"> 
    <RelativeLayout 
     d1p1:minWidth="25px" 
     d1p1:minHeight="25px" 
     d1p1:id="@+id/relativeLayout1" 
     d1p1:layout_width="wrap_content" 
     d1p1:layout_height="wrap_content" 
     d1p1:layout_alignParentTop="true"> 
     <LinearLayout 
      d1p1:orientation="vertical" 
      d1p1:minWidth="25px" 
      d1p1:minHeight="25px" 
      d1p1:layout_width="wrap_content" 
      d1p1:layout_height="wrap_content" 
      d1p1:id="@+id/linearLayout1" 
      d1p1:layout_alignParentRight="true"> 
      <TextView 
       d1p1:text="Time Remaining" 
       d1p1:textAppearance="?android:attr/textAppearanceSmall" 
       d1p1:id="@+id/studentQuestionZoneQuestionContent_textView_timeRemainingLabel" 
       d1p1:typeface="normal" 
       d1p1:textSize="22sp" 
       d1p1:textColor="#ff000000" 
       d1p1:layout_width="fill_parent" 
       d1p1:layout_height="wrap_content" /> 
      <LinearLayout 
       d1p1:orientation="horizontal" 
       d1p1:minWidth="25px" 
       d1p1:minHeight="25px" 
       d1p1:layout_width="fill_parent" 
       d1p1:layout_height="wrap_content" 
       d1p1:id="@+id/linearLayout2" 
       d1p1:gravity="center_horizontal"> 
       <TextView 
        d1p1:text="XXX" 
        d1p1:textAppearance="?android:attr/textAppearanceSmall" 
        d1p1:id="@+id/studentQuestionZoneQuestionContent_textView_timeValue" 
        d1p1:typeface="normal" 
        d1p1:textSize="25sp" 
        d1p1:textColor="#ff000000" 
        d1p1:layout_width="wrap_content" 
        d1p1:layout_height="fill_parent" 
        d1p1:gravity="bottom" /> 
       <TextView 
        d1p1:text="Seconds" 
        d1p1:textAppearance="?android:attr/textAppearanceSmall" 
        d1p1:id="@+id/studentQuestionZoneQuestionContent_textView_timeValueUnits" 
        d1p1:layout_width="wrap_content" 
        d1p1:layout_height="fill_parent" 
        d1p1:typeface="normal" 
        d1p1:textSize="19sp" 
        d1p1:textColor="#ff000000" 
        d1p1:gravity="bottom" 
        d1p1:paddingLeft="10dp" /> 
      </LinearLayout> 
     </LinearLayout> 
     <TextView 
      d1p1:text="Question Description" 
      d1p1:textAppearance="?android:attr/textAppearanceLarge" 
      d1p1:layout_width="wrap_content" 
      d1p1:layout_height="wrap_content" 
      d1p1:id="@+id/studentQuestionZoneQuestionContent_textView_questionDescription" 
      d1p1:layout_centerInParent="true" 
      d1p1:typeface="normal" 
      d1p1:textSize="25sp" 
      d1p1:textColor="#ff000000" /> 
    </RelativeLayout> 
    <SlidingDrawer 
     d1p1:content="@+id/content" 
     d1p1:handle="@+id/handle" 
     d1p1:minWidth="25px" 
     d1p1:minHeight="25px" 
     d1p1:layout_width="fill_parent" 
     d1p1:layout_height="fill_parent" 
     d1p1:id="@+id/slidingDrawer1" 
     d1p1:layout_alignParentBottom="true" 
     d1p1:layout_centerHorizontal="true" 
     d1p1:background="#00000000"> 
     <Button 
      d1p1:id="@+id/handle" 
      d1p1:layout_width="wrap_content" 
      d1p1:layout_height="wrap_content" 
      d1p1:text="Scratchpad" 
      d1p1:background="@drawable/button_question_zone_scratch_pad_without_annotation" /> 
     <LinearLayout 
      d1p1:id="@+id/content" 
      d1p1:layout_width="match_parent" 
      d1p1:layout_height="match_parent" 
      d1p1:minWidth="25px" 
      d1p1:minHeight="25px"> 
      <SurfaceView 
       d1p1:layout_width="fill_parent" 
       d1p1:layout_height="fill_parent" 
       d1p1:id="@+id/surfaceView1" 
       d1p1:background="#ffffffff" /> 
     </LinearLayout> 
    </SlidingDrawer> 
    <Button 
     d1p1:text="Scratchpad" 
     d1p1:id="@+id/studentQuestionZoneQuestionContent_button_scratchpad" 
     d1p1:background="@drawable/button_question_zone_scratch_pad_without_annotation" 
     d1p1:typeface="normal" 
     d1p1:textSize="22sp" 
     d1p1:textStyle="bold" 
     d1p1:textColor="#ff666666" 
     d1p1:layout_width="wrap_content" 
     d1p1:layout_height="wrap_content" 
     d1p1:layout_alignParentBottom="true" 
     d1p1:layout_centerHorizontal="true" 
     d1p1:paddingLeft="50dp" 
     d1p1:paddingRight="10dp" 
     d1p1:visibility="invisible" /> 
    <WebView 
     d1p1:id="@+id/studentQuestionZoneQuestionContent_webView_content" 
     d1p1:layout_below="@id/relativeLayout1" 
     d1p1:layout_above="@id/studentQuestionZoneQuestionContent_button_scratchpad" 
     d1p1:layout_width="fill_parent" 
     d1p1:layout_height="fill_parent" /> 
    <ProgressBar 
     style="@android:style/Widget.Holo.ProgressBar.Large" 
     d1p1:layout_width="wrap_content" 
     d1p1:layout_height="wrap_content" 
     d1p1:id="@+id/studentQuestionZoneQuestionContent_progress_loadingContent" 
     d1p1:layout_below="@id/relativeLayout1" 
     d1p1:layout_above="@id/studentQuestionZoneQuestionContent_button_scratchpad" 
     d1p1:layout_centerHorizontal="true" /> 
</RelativeLayout> 

ответ

1

Перестановка файл макета, так что SlidingDrawer код появится ниже WebView кода. Z-индекс ваших виджетов определяется его положением в файле. Виджет, расположенный дальше по файлу, имеет более высокий индекс z.

Вы также можете использовать View.bringToFront().

Смежные вопросы