2011-04-26 3 views

답변

0

당신은 사용할 수 있습니다 include tag 또는 viewstub 또는 fragments

다음

당신이

  1. 이 도구 모음을 설명 레이아웃 파일, 예를 들어, 만들기 원하는 것을 달성하기 위해 include을 사용하는 방법 당신이 당신의 도구 모음을 표시 할 각 XML 레이아웃 파일에서 toolbar.xml
  2. 은 toolbar.xml를 가리키는 include 태그를 추가

예 :

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_height="fill_parent" android:layout_width="fill_parent"> 
    <include android:id="@+id/titleBar" layout="@layout/title_bar" 
     android:layout_width="fill_parent" android:layout_height="48dip" /> 
    <!-- All the rest of your activity layout below --> 
</RelativeLayout> 
+0

이 유 데모 예제를 줄 수 있습니까 ?? – user725753

+0

물론, 나는 내 대답을 연장했다. – Bostone

관련 문제