[英]Use AppCompat themes with framework activity
I want to use Theme.Appcompat.Light
as the application theme to introduce Material Design to platform version 19: 我想使用
Theme.Appcompat.Light
作为应用程序主题,以将Material Design引入平台版本19:
<style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light">
But I don't quite like extending support library ActionBarActivity
since I'm not going to support platforms below version 19 and the framework Activity
should already have an action bar in platform version 19. 但是我不太喜欢扩展支持库
ActionBarActivity
因为我将不支持版本19以下的平台,而框架Activity
在平台版本19中应该已经有一个操作栏。
Is this possible? 这可能吗?
From the recent post on getting started with AppCompat : 从最近关于AppCompat入门的文章中:
If you are not currently using AppCompat, or you are starting from scratch, here's how to set it up:
如果您当前不使用AppCompat,或者从头开始,请按以下步骤进行设置:
All of your Activities must extend from ActionBarActivity, which extends from FragmentActivity from the v4 support library, so you can continue to use fragments.
您所有的活动都必须从ActionBarActivity扩展,而ActionBarActivity从v4支持库的FragmentActivity扩展,因此您可以继续使用片段。
So to answer your question 所以回答你的问题
Is this possible?
这可能吗?
No it is not. 不它不是。 You need to extend from
ActionBarActivity
to use the Theme.Appcompat.Light
, even if you're not planning to support anything under v19. 您需要从
ActionBarActivity
扩展以使用Theme.Appcompat.Light
,即使您不打算在v19下支持任何功能。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.