android中title样式问题

============问题描述============


要在title栏里设置一个button,新建了title.xml,也在OnCreate方法里调用了requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.activity_main);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,
R.layout.title_btn);
但是出错,you cannot combine custom titles with other title features,按照网上的几种方法都试了,结果要不是you cannot combine custom titles with other title features就是03-26 01:54:02.073: E/AndroidRuntime(2790): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.camera/com.example.camera.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
请问前辈这个问题怎么解决啊?

============解决方案1============


http://mobile.51cto.com/aprogram-387074.htm 希望有所帮助

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。