如何添加页眉和页脚在Android的每个活动 [英] How to add header and Footer to each activity in android
问题描述
我要添加的ImageButton
,一个按钮
和的TextView
在每个我在顶部和bottom.I活动想过用页眉和页脚
的。所以我想添加页眉和页脚在每个我的Android活动。我没有怎么做到这一点的想法。我不需要怎么写页眉或页脚源$ C $ C。我想知道的是我必须定义页眉和页脚的手段做我需要添加页眉和页脚中的每个XML文件或做我需要定义两个 header.xml
或 footer.xml
并在每个其他XML文件使用这些XML文件。或者是有任何其他方式的意思是想利用这一活动中的java文件的引用。任何帮助鸭preciated。
I want to add a ImageButton
, a button
and a textview
in each of my activity at top and bottom.I thought of using header and footer
. So I want to add a header and footer in each of my Android Activity. I don't have any idea of how to do that. I don't need source code of how to write a header or footer. What i want to know is where i have to define that header and footer means do i need to add a header and footer in each xml file or do i need to define two header.xml
or footer.xml
and use these xml files in each of other xml files. Or is there any other way mean like using a reference from the java file of that activity. Any help Appreciated.
推荐答案
定义两个单独的文件 header.xml
和 footer.xml
键,而且比使用
Define two separate files header.xml
and footer.xml
and and than use
`<include layout="@layout/header"/>
<include layout="@layout/footer"/>`
这篇关于如何添加页眉和页脚在Android的每个活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!