2016-10-03 3 views
2

나는이 인터페이스를 구축하기위한 최상의 부모 레이아웃을 알아 내려고하고있다.이 인터페이스에 가장 적합한 상위 레이아웃은 무엇입니까?

A) 모두를 포함하는 뷰 그룹 : 여기

enter image description here

은 몇 가지 추가 정보/요구 사항입니다. 가능한 수직 간격을 가로 항목의리스트를 스크롤

C) RecylcerView 채우고

B)지도보기. 내가 보기에 대해 서로 다른 선택의 여지를 시도

보기 C. 오른쪽 상단에있는보기 B + C. 그것은의 앵커의 꼭대기에 앉아 고정 된 높이 (예 : 200 DP)

D)을 FloatingActionButton 가지고 A,하지만 그들은 작동하지 않는 것 같습니다.

  • 있는 LinearLayout은 :있는 LinearLayout 그래서 FloatActionButton가 차단의 얻을 Z 지수의 어떤 개념이 없습니다.
  • RelativeLayout의 : RelativeLayout의는 전혀 개념이없는지도보기의 높이가 동적하지 않고 FrameLayout이
  • 을 수정해야하므로 "수직 공간을 나머지를 기입"RelativeLayout의 동일 문제를 해결합니다.

또한 사용자가 FloatingActionButton을 탭하면이 액티비티에 조각 모달을 삽입해야하므로이 현재 레이아웃 위에 배치됩니다.

도움이 될 것입니다. 정말 고맙습니다!!!

답변

1

은 아마 무엇인가 - 새 화면으로의 전환에 대한

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout android:id="@+id/layout_a" 
      xmlns:android="http://schemas.android.com/apk/res/android" 
      xmlns:app="http://schemas.android.com/apk/res-auto" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:orientation="vertical"> 

<android.support.v7.widget.RecyclerView 
     android:id="@+id/layout_c" 
     android:layout_width="match_parent" 
     android:layout_height="200dp" 
     android:layout_alignParentBottom="true"/> 


<com.google.android.gms.maps.MapView 
     android:id="@+id/layout_b" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_above="@id/layout_c"/> 


<android.support.design.widget.FloatingActionButton 
     android:id="@+id/fab_d" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentRight="true" 
     android:layout_marginBottom="200dp" 
     android:layout_marginRight="16dp" 
     app:fabSize="normal"/> 

</RelativeLayout> 
+0

당신은 많은 옵션을 가지고있다. 새로운 액티비티를 시작하거나, DialogFragment를 시작하거나, 전체 화면을 채우는 상대적 레이아웃에 프레임 레이 아웃을 추가 할 수 있습니다. –

+0

고마워요! 여기에서 핵심은 mapView의 'android : layout_above' 속성으로, 수직 간격을 채울 수 있습니다! – blee908

관련 문제