Common bottom layout in all the tabs of TabHost in Android?

℡╲_俬逩灬. 提交于 2019-12-06 16:10:54

The simplest solution would be to use the <include> option in your layout files.

Define the common footer in a layout file all by itself - e.g tab_footer.xml - and then include it into the the other layouts as follows:

<include layout="@layout/tab_footer">

You can find out more about <include> in this post on the Android Developers Blog.

One thing that isn't mentioned in that post: if you want to override any layout parameters when you use <include> make sure you override layout_width and layout_height (even if they're not changing) otherwise your values for other parameters will be silently ignored.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!