동적 목록과 마지막 항목 아래에 정적 선형 레이아웃이 있습니다. 목록이 비어 있으면 LinearLayout
이 페이지 상단에 있습니다.Dynamic RecyclerView 아래의 LinearLayout 목록보기
목록에 요소를 추가 할 때마다 LinearLayout
이 목록의 마지막 항목 아래로 이동합니다. 목록이 길어지면 고정 LinearLayout
은 화면 끝 부분에 있어야합니다. 나는 더 나은 이해를 위해 몇 가지 예를 그린다.
그러나 필자는 7 요소를 추가 할 때마다, 내 선형 레이아웃 목록 아래에 숨어있다.
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/app_margin"
android:id="@+id/group_manage_list_view"
android:paddingBottom="40dp"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="@+id/group_manage_list_view"
>
<Button
android:layout_width="34dp"
android:layout_height="34dp"
android:background="@drawable/ic_add_circle_outline_white_24dp"
android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/app_margin"
android:backgroundTint="@color/headline_grey"
android:id="@+id/create_group_button_click"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/add_group"
android:layout_marginLeft="@dimen/app_margin"
android:layout_gravity="center_vertical"
/>
</LinearLayout>
</RelativeLayout>
흠 나는이 예가 목록에 2 개의 항목을 가지고있을 때이 방법이 효과가 있습니까? 목록 크기를 확인하고 listView를 볼 때 화면에 1.8 공간이 필요하고 선형 레이아웃이 화면 하단에 표시됩니까? – Expiredmind
예, 만료되었습니다. 목록에 데이터가있는 경우 화면에 표시되며 선형 레이아웃은 아래쪽에 표시됩니다. 선형 레이아웃은 표시되지 않고 문제가 해결됩니다. –
@Expiredmind는 귀하의 문제가 해결되지 않았습니까? –