2013-06-12 3 views

답변

0

하나의 간단한 해결책은 이미지를 활동의 루트보기의 배경으로 설정하는 것입니다.

1

FrameLayout 너비와 높이 모두 ImageView"match_parent" 차원의 XML 레이아웃 파일 끝에 설정할 수 있습니다. XML 레이아웃 파일에서 가시성을 "사라지게"설정하십시오. 코드에서 문제가되는 것은이 전체 화면 이미지를 표시하고 그 아래에 배치 된 다른 모든 구성 요소를 숨기려면 표시 여부를 변경하는 것입니다.

<FrameLayout 
    android:id="@+id/lockScreenLayout" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:visibility="gone" > 
    <ImageView 
     android:id="@+id/imageView" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"   
     android:background="@drawable/your_iamge" 
     android:contentDescription="@drawable/your_iamge" /> 
</FrameLayout> 

은 그래서 루트 XML 요소의 자식이 될 것입니다 : XML 파일의 예를 들어

는 XML의 끝이를 넣어.

다음 코드에서

다음을 수행하십시오

lockScreenLayout = (FrameLayout) findViewById(R.id.lockScreenLayout); 
lockScreenLayout.setVisibility(View.VISIBLE); 
관련 문제