2013-10-21 6 views
0

TextViewSeekBar에 기본 회색/검정 홀로 배경을 어떻게 추가합니까? 둘 다 FrameLayout에 포함 된 카메라 미리보기 위에 오버레이됩니다. 현재 누락 된 배경으로 인해 둘 다 겨우 눈에 띄지 않습니다.안드로이드 레이아웃을위한 배경 화면

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

    <FrameLayout 
     android:id="@+id/scanner_camera_preview" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" /> 

    <TextView 
     android:id="@+id/scanner_help_text" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true" 
     android:text="Den Zoom-Regler benutzen um den Barcode auszuwählen." /> 

    <SeekBar 
     android:id="@+id/scanner_camera_seek" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_above="@id/scanner_help_text" /> 

</RelativeLayout> 

답변

1

은 this..I로 XML 레이아웃은 텍스트보기 및 SeekBar를위한 빨강 색 보라색 색상을 추가 한 수정합니다. 필요에 따라 변경하십시오.

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

    <FrameLayout 
      android:id="@+id/scanner_camera_preview" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" /> 

    <TextView 
      android:id="@+id/scanner_help_text" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_alignParentBottom="true" 
      android:background="@android:color/holo_purple" 
      android:text="Den Zoom-Regler benutzen um den Barcode auszuwählen." /> 

    <SeekBar 
      android:id="@+id/scanner_camera_seek" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_above="@id/scanner_help_text" 
      android:background="@android:color/holo_red_light"/> 

</RelativeLayout> 
+0

내 활동에서 현재 사용중인 배경색은 어떻게 선택합니까? – multiholle

+0

@multiholle : 간단히 설명해 주시겠습니까? 배경이 동적이어야합니까? –

+0

테마에 따라 배경이 밝거나 어둡습니다. 현재 사용되는 색상은 어떻게 얻을 수 있습니까? – multiholle

-1
android:background="@drawable/yourdrawable" 
+0

배경 이미지를 추가하고 싶지 않습니다. – multiholle

+0

단순히 드로어 블을 컬러로 변경해야만했습니다.) ... –

관련 문제