2014-09-02 63 views
0

是否可以使用Android注释API设置自定义标题?以前我会打电话自定义标题与Android注释

requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); 

getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title_layout); 
在onCreate方法

,但这并没有出现在注释的方法@AfterViews成为可能,因为它被设定内容查看之前完成。有没有办法做到这一点?

+0

看看这个http://androidcodesnippetsblog.blogspot.in/2013/03/custom-window-title-bar-in-android.html – 2014-09-02 04:49:37

+0

博客中描述的方法是指我用来添加标题的方式到活动。我在问题中提到的代码(在博客中提到)必须放在onCreate方法中,requestWindowFeature必须在contentView设置之前进行。使用AndroidAnnotations时,它看起来像我不能使用onCreate方法。 – 2014-09-02 05:22:18

+0

伙计们,你应该看看AA [wiki](https://github.com/excilys/androidannotations/wiki)。 – WonderCsabo 2014-09-02 15:39:34

回答

1

我在使用com.googlecode.androidannotations,androidannotations-api版本2.7.1。有一个更新的版本; org.androidannotations,androidannotations版本3.0.1,其中包含@CustomTitle注释完美的作品。