2014-09-18 12 views
0

내가 활동보기에서 정적 버튼이 있습니다왜이 Android 버튼이 투명합니까?

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:id="@+id/layout_record" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context="${relativePackage}.${activityClass}" > 

    <Button 
     android:id="@+id/button_review" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentRight="true" 
     android:layout_alignParentTop="true" 
     android:text="Review" 
     android:color="#e5e5e5" 
     android:alpha="1" /> 

</RelativeLayout> 

나중에 일부 코드는 버튼 뒤에 클래스를 파생 된 서피스 뷰 SurfaceView를 삽입됩니다 (같은 일을 : ("layoutRecord".addChild (서피스 뷰 SurfaceView, getViewById 0))

문제는 버튼이 투명하고보기 어렵다는 것입니다. 버튼의 색상과 알파를 설정하고 있습니다. addChild (surfaceView, 1)를 호출하면 컨트롤이 올바른 순서로 스택되어 있다고 믿습니다. surfaceView가 버튼을 완전히 숨 깁니다.

왜 버튼이 여전히 tr입니까? ansparent?

+0

에 한번 사용하는 배경 대신 Color 속성 –

답변

0

안드로이드 : 색상 = "#의 e5e5e5"버튼 만 텍스트 색상, backgrount입니다 등의 거기이 속성이 아니라 색상

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:orientation="vertical" 
android:id="@+id/layout_record" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
tools:context="${relativePackage}.${activityClass}" > 

<Button 
    android:id="@+id/button_review" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentRight="true" 
    android:layout_alignParentTop="true" 
    android:text="Review" 
    android:background="#e5e5e5" 
    android:alpha="1" /> 

관련 문제