2012-07-25 8 views
2

내 레이아웃에서 DecorView의 하위가 FrameLayout 인 이유를 설명 할 수 있습니까? 여기 DecorView Child FrameLayout

당신은 DecorView하고 정상적인 테마를 사용하는 경우 Activity의 컨텐츠를 보유하고있는 FrameLayout 사이 LinearLayout을해야하는 XML 레이아웃을

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:background="@drawable/background_general" > 

<ImageView 
    android:id="@+id/ivIKUGo" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_centerHorizontal="true" 
    android:layout_centerVertical="true" 
    android:src="@drawable/mainbutton_selector" /> 

<ImageView 
    android:id="@+id/imageViewmoto" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true" 
    android:layout_alignParentLeft="true" 
    android:layout_marginBottom="150dp" 
    android:src="@drawable/motto_buttonpage_hdpi" /> 

</RelativeLayout> 

감사

+0

액티비티가 안드로이드에서 구축되는 방식입니다. 콘텐츠 이외에도 활동은 액션 바처럼 다른 요소를 보여줄 수 있습니다. 액티비티의 내용은'id'' android.R.id.content'를 가진'FrameLayout'에 추가됩니다. – Luksprog

+0

@Luksprog DevorView의 자식이 LinearLayout이라는 또 다른 예제 프로젝트가 있는데,이 프로젝트에서 뭔가 다른 점이 있습니까? – pamgeo

+0

'DecorView'가 어떻게 만들어 졌는지 정확히 기억하지 못하지만'setContentView'로 설정 한 레이아웃은'FrameLayout'에'android.R.id.content'라는 ID로 추가됩니다. 'DecorView'에 관심이있는 특별한 이유가 있습니까? – Luksprog

답변

2

입니다. NoTitleBar 유형의 테마를 사용하는 경우 추가 LinearLayout이 필요하지 않으므로 콘텐츠 FrameLayoutDecorView의 하위로 둡니다.