Android 布局中的include标签使用
Android 布局中的include标签使用 最近在布局时,有好多页面都是有共同特点的,比如标题:一个同样的样式! 如下图所示: 如果给每个页面都单独的写一个标题的布局那就太麻烦了,如果能写一个标题布局,其它页面重用该多好! 这个时候, <include> 就隆重登场了! 写一个标题的布局 title.xml : <?xml version="1.0" encoding="utf-8"?> < RelativeLayout xmlns:android = "http://schemas.android.com/apk/res/android" android:layout_width = "match_parent" android:layout_height = "wrap_content" android:background = "@drawable/navigation_bar" > < ImageView android:id = "@+id/img_backward" android:layout_alignParentLeft = "true" android:layout_centerVertical = "true" android:layout_marginLeft = "25dp" android:layout_gravity = "center"