2017-01-13 1 views
0

저는 사용자 정의 하단 네비게이션 메뉴를 LinearLayout으로 만들었습니다. 팽창 된 레이아웃이 내용물을 중첩합니다.

android:layout_alignParentBottom="true" 

내 하단 메뉴를 팽창

는,이 바닥에 닿는 다른 내용을 겹쳐 메뉴의 원인이있는 LinearLayout 일부 활동이 보는 모두는 태그가 있습니다. 팽창하기 위해, 나는 사용

RelativeLayout main = (RelativeLayout) findViewById(R.id.activity_list); 
View view = getLayoutInflater().inflate(R.layout.bottom_menu, main,false); 
main.addView(view); 

때문에 활동 내용은 하단의 메뉴 위에 대신 그 아래 배치 팽창 후 활동 프레임을 '크기 조정'할 수있는 좋은 방법이 있나요?

편집 : Roman Kolomenskii의 도움으로 편집 한 문제를 해결했습니다. 내 활동의 바닥에 (포장 콘텐츠)의 LinearLayout을 추가하고 해당 컨테이너 이상으로 다른 항목을 설정하고이 내 자바 코드를 변경 : 나는 다음과 같은 레이아웃 구조를 구현해야합니다 제안

LinearLayout container = (LinearLayout) findViewById(R.id.bottom_menu_container); 
View bottomMenu = getLayoutInflater().inflate(R.layout.bottom_menu, container, false); 
container.addView(bottomMenu); 

답변

0

나는 android:height="wrap_content". 그냥이 컨테이너에 비정상적으로 메뉴를 추가 한 후 android:layout_above="@+id/bottom_container" 모든 android:layout_alignParentBottom="true" 교체와 함께 활동의 바닥에 일부 컨테이너 레이아웃을 추가 건의 할 것입니다.

0

을 :

 <RelativeLayout> 

      <RelativeLayout> //pin this to the top of your custom menu 
      </RelativeLayout> 

      <YourCustomMenuLayout> //pin this to the bottom of the outer relative layout 
      </YourCustomMenuLayout> 

     </RelativeLayout> 
관련 문제