나는 다른보기를 완전히 회색으로 덮고있는보기를 만들기 위해 노력하고 있습니다. 그래서 RelativeLayout을 사용하여 약간 투명한 색을 가진 뷰를 추가했습니다. 그러나, 비록 "fill_parent"를 사용하고 있지만, 맨 위의 뷰는 0 개의 높이를 차지합니다. 예를 들어 TextView로 변경하면 wrap_content만큼 많은 공간을 차지합니다. 내 뷰를 전체 뷰의 맨 아래에 표시하려면 어떻게해야합니까 (크기가 다를 수 있음)? 내 실제 코드 :다른보기를 완전히 덮어보기
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/unit_entry"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingBottom="3dip">
<include layout="@layout/view_stats"
android:id="@+id/unit_stats"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="@id/unit_stats">
<LinearLayout
android:layout_weight="1"
android:layout_width="0dip"
android:layout_height="fill_parent"
android:orientation="vertical">
<include layout="@layout/view_heading_value_text"
android:id="@+id/unit_exp_layout"/>
<TextView
android:id="@+id/unit_skills_text"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:hint="@string/skills_injuries_hint"
android:background="@drawable/border"/>
</LinearLayout>
<TextView
android:id="@+id/unit_equipment_text"
android:layout_weight="1"
android:layout_width="0dip"
android:layout_height="fill_parent"
android:hint="@string/equipment_hint"
android:background="@drawable/border"/>
</LinearLayout>
<View android:id="@+id/unit_overlay"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:background="@color/gray_overlay"
/>
</RelativeLayout>
예 내가 원하는 것을 설명하기 :
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/unit_entry"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingBottom="3dip">
<TextView
android:id="@+id/text1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="text1"/>
<TextView
android:id="@+id/text2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/text1"
android:text="text2"/>
<View android:id="@+id/unit_overlay"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:background="#88666666"
/>
</RelativeLayout>
이 예제에서는 내가 unit_overlay이 텍스트 1, 텍스트 2를 모두 포함 할 것이다.
당신도 당신의 포함 레이아웃을 게시 할 수 있을까요? 왜냐하면 나는이 코드를 사용할 수 없기 때문이다. .. –
왜 안드로이드 : orientation = "vertical"이 보이지? – TheRedFox
@ FarukYazıcı 더 쉽게 테스트 할 수있는 예제가 추가되었습니다. – schoel