活动的布局继承 [英] Activity layout inheritance
问题描述
我开始开发的Android应用程序! 我需要表现出几个屏幕顶部的集中控制。 在黑莓我刚刚继承我的屏幕从基本屏幕,需要控制和继承它的用户界面和行为的基本类型。
I start develop application on Android! I need to show common control on the top of few screens. In Blackberry I just inherit my screens from base screen with needed controls and it inherit UI and behaviour from base type.
怎么做类似的事情,在Android中?我的意思是,我该如何安排呢? 也许,我需要创建的控制或布局,我可以在我的屏幕上使用? 或者我需要从另一个继承一个活动,并使用addContentView()?
How can i do similar thing in Android? I mean, how can i organize it? Maybe, i need to create control or layout, which i can use on my screens? Or i need inherit one activity from another and use addContentView()?
什么样的机会是有什么优势/各的缺点是什么?
What opportunities are there and what advantages / disadvantages of each?
推荐答案
Try the <include>
XML layout directive.
这篇关于活动的布局继承的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!