2010-04-23 4 views
0

다음 구조는 xml 레이아웃 파일에 정의되어 있습니다.RelativeLayout - ViewGroup 아래에 뷰 배치

<RelativeLayout android:id="@+id/mainLayout" 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="wrap_content" android:layout_height="wrap_content"> 
<FrameLayout android:id="@+id/frame" android:layout_centerInParent="true" android:layout_width="wrap_content" android:layout_height="wrap_content" ></FrameLayout> 
<Button android:id="@+id/button" android:layout_below="@id/frame" android:layout_width="wrap_content" android:layout_height="wrap_content" /> 
</RelativeLayout> 

FrameLayout은 부모의 가운데에 올바르게 배치됩니다. 그러나 버튼은 그 아래에 위치하지 않습니다. 대신 왼쪽 상단에 표시됩니다.

내가 뭔가 잘못하고 있거나 RelativeLayout에 버그가 있습니까?

답변

0

프레임 레이아웃이 부모 중심에 있는지 여부는 어떻게 확인 했습니까?

프레임 레이아웃 내부에 일부보기를 추가하거나 고정 높이와 너비를 지정하십시오. 문제가 해결 될 수도 있습니다.