2012-05-01 1 views

답변

0

FrameLayout에서 문제가 해결되었습니다. 중첩을 허용하는 FrameLayout Views

1

예, 레이아웃이 가능합니다!

<RelativeLayout android:layout_width="fill_parent" 
     android:layout_height="fill_parent"> 
    <ViewFlipper android:layout_width="fill_parent" 
     android:layout_height="fill_parent"> 
    </ViewFlipper> 
    <!-- I assumed your layout at the top-left corner is a LinearLayout, otherwise replace it with what you have --> 
    <LinearLayout android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentTop="true" 
     android:layout_alignParentLeft="true" 
     android:id="@+id/firstLayout"> 
    </LinearLayout> 
    <TextView android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_toRightOf="@id/firstLayout" 
    android:layout_margin="5dp"/> 
</RelativeLayout> 

편집 :

TextViewLayout 요소 옆에 추가 한 다음 TextView을 추가하고 toRightOf (약간의 여백을두고 약간의 공백을 넣음) 속성을 설정하는 경우 약간의 모호함이 있습니다. 위의 레이아웃에서 수정을 확인하십시오. TextView을 (가로 : Layout을 고려하여 높이를 고려하여) 세로 가운데에 표시하려면 LayoutTextView을 너비와 높이가 wrap_contentLinearLayout에 넣고 상단 및 왼쪽에 정렬 할 수 있습니다. 학부모 RelativeLayout.

+0

감사합니다. 같은 것을 시도했습니다. –

+0

감사합니다. 같은 것을 시도했습니다. 그러나이 경우 : 레이아웃 측면에 텍스트 뷰를 설정해야합니다 (같은 줄에 있음) –

+0

@AndroidUser 내 대답을 편집했습니다. – Luksprog

0

귀하의 질문은 분명하지 않지만, 왼쪽 상단 레이아웃과 텍스트보기를 래퍼 선형 레이아웃에 넣고 싶다는 점을 제외하고는 Kursprog가 제공 한 바를 정확히 찾고 있습니다. xml은 다음과 같습니다 (모든 속성을 뺀 것).

<RelativeLayout> <!--Parent --> 
    <ViewFlipper/> 
    <LinearLayout android:orientation="horizontal"><!-- wrapper to your two top layouts 
     <LinearLayout/> <!-- whatever layout it is that you're describing in your diagram --> 
     <TextView/> <!-- the text view in your diagram --> 
    </LinearLayout> 
</RelativeLayout> 

당신은 그들이 화면에 고르게 분포하고 있도록 랩퍼가 fill_parent의 폭을 제공하고 1로 모두 내부 요소의 layout_weight를 설정하는 것이 좋습니다.

+0

FrameLayout의 문제를 해결했습니다. 겹치는보기를 허용하는 FrameLayout –

관련 문제