2013-07-03 4 views
0

나는 안드로이드 프로젝트를 진행 중입니다. 그리고 버튼 클릭시 사용자 정의 제목 표시 줄을 표시하거나 숨기려고합니다. 이 버튼은 미디어 플레이어 용입니다 (전체 화면 크기/사용자 정의 화면 크기). 제발 도와주세요. 숨기기 사용자 정의 제목 내가 다음 코드를 사용하여 사용하고커스텀 타이틀 숨기기/보이기 안드로이드에서 버튼 클릭시

@Override 
    protected void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); 
     setContentView(R.layout.activity_main1); 
     ctx=this; 
     getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,R.layout.custom_title1); 
    // FrameLayout frameLayout = (FrameLayout) findViewById(R.id.menu); 
    // FrameLayout frameLayout2 = (FrameLayout) findViewById(R.id.menu1); 

onClick()

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); 

답변

0

이 작업 표시 줄을 숨길 것이다는 :

this.requestWindowFeature(Window.FEATURE_NO_TITLE); 

이 그를 다시 만들 것입니다 :

this.requestWindowFeature(Window.FEATURE_ACTION_BAR); 
+0

감사합니다. 이 코드를 시도했지만 오류를 발견했습니다 07-03 10 : 57 : 56.519 : E/AndroidRuntime (1101) : android.util.AndroidRuntimeException : content를 추가하기 전에 requestFeature()를 호출해야합니다. – Pankaj

관련 문제