2011-12-30 1 views
7

현재 Android 프로젝트에서 작업 중이며 SlidingDrawer를 사용하고 있지만 배경색을 변경하는 데 문제가 있습니다.슬라이딩 서랍의 배경색

기본적으로 SlidingDrawer는 투명하게 보이므로 내용 위로 밀어 올리면 주 화면이 아래에 표시되어 슬라이딩 드로어의 내용을 읽기가 어렵습니다.

배경색을 검정색으로 변경하고 싶었지만 어떤 이유 때문에 메인 콘텐츠의 배경색이 변경되어 슬라이딩 서랍의 내용 만 볼 수 없게되었습니다. 화면. 다음은

내가 슬라이딩 서랍 당신이 제공 할 수있는 어떤 도움

<SlidingDrawer 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:id="@+id/drawer" 
     android:handle="@+id/handle" 
     android:content="@+id/content" 
     android:background="@color/black"> 
     <ImageView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:id="@+id/handle" 
      android:src="@drawable/ic_launcher"/> 
     <LinearLayout 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:orientation="vertical" 
      android:id="@+id/content"> 
     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="I am a sliding drawer - Hello World"/> 
     </LinearLayout> 
    </SlidingDrawer> 

감사를 생성하는 데 사용했던 코드입니다.

답변

6

는이 같은 내용의 LinearLayout 가진 ID로 배경을 제공 :

<LinearLayout android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:orientation="vertical" 
      android:id="@+id/content" 
      android:background="#000"> 
+0

건배 큰 일을, 내가 그 생각을하지 않은 이유를 알고하지 않습니다. 다시 한 번 감사합니다 – Boardy

+1

이것은 나에게도 적합하지만 ICS와 Honeycomb에는 이상한 문제가 있습니다. 서랍을 열 때 내용의 일부가 투명하거나 검은 색 배경이됩니다. 매우 좌절! – Peterdk