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 希望有所帮助
posted @ 2014-11-12 11:38  android开发视频教程  阅读(186)  评论(0编辑  收藏  举报
我要啦免费统计