2012-02-01 6 views
1

나는 요구 사항을 가지고있다 ... 투명 레이아웃 (80 % 투명)을 원한다. 그래서 배경이 보이도록해야한다. 같은 일을 할 수있는 방법이 있습니까 .. ???? 투명한 레이아웃 ...?

나는

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:orientation="vertical" 
    android:background="#C0C0C0"> 



    <LinearLayout 
     android:id="@+id/linearLayout1" 
     android:layout_width="match_parent" 
     android:layout_height="60dip" 
     android:background="@drawable/style"> 

     <TextView 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:text="@string/hello" /> 

    </LinearLayout> 

</LinearLayout> 

<?xml version="1.0" encoding="UTF-8"?> 
<resources> 
    <style name="YourTheme" parent="android:@Theme.Translucent"> 
      <item name="android:windowBackground">@color/background</item> 
    </style> 
</resources> 

<?xml version="1.0" encoding="UTF-8"?> 
<resources> 
    <color name="background">#55000000</color> 
</resources> 

있지만 작동하지 않습니다 (하지만해야 제 2 투명 선형 레이아웃을 working..that하지 않음) 것을 시도했다. 그 두 번째 선형 레이아웃은 투명해야합니다.

감사합니다 .....

+0

받고있는 사진을 게시 할 수 있습니까? 그리고 transperent는 무엇을 의미합니까? 당신의 벽지가 반투명 한 배경 아래서 보이기를 원하십니까? – Hiral

+0

정확히 ... 내 요구 사항이 있습니다. 반 transperent 배경 아래에서 볼 수있는 벽지 .. ????. – KKC

+0

하지만 당신은 xml의 일부분에 대해서는 그렇게 할 수 없습니다. 당신은 완전한 활동을 transperent.please로 만들 수 있습니다. http://developer.android.com/resources/samples/ApiDemos/src/com/example/android를 참조하십시오. /apis/app/TranslucentBlurActivity.html 및 http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/TranslucentActivity.html – Hiral

답변

0

테마 부모 = "안드로이드 : @ Theme.Translucent는"정확하지만, 문제에 대한 매니페스트 파일에 테마를 구현 한 후 요구 사항에 따라 레이아웃 크기를 변경하고있다 그 활동. 이게 효과가있다. =

당신은 FF (헥사 진수) 최대 투명성

00에서 범위 수 있습니다 .... 레이아웃 높이를 기억하고 폭은 명시 적으로

+0

채우기 부모 대신 레이아웃 높이 및 너비 사용 eg.200dip – aviz

+0

사실 나는 모든 활동을위한 것이 아닌 특정 레이아웃의 투명성을 원합니다. 예를 들어 선형 레이아웃 배경에서 세미 transperent 배경 아래에서 볼 수 있습니다. – KKC

0

안녕하세요 여기에 문제의 솔루션입니다 언급해야한다 > # 00555555 (알파은 여기 00 스탠드)

최소

또는 투명도는 => #의 FF555555

는이처럼있는 LinearLayout의 알파를 설정할 수 있습니다 (여기서 FF는 알파의 약자) :

LinearLayout ll = (LinearLayout) findViewById(R.id.linearlayout1); 


ll.setAlpha(0.4);