2012-02-27 76 views
0

我使用API​​ 10薑餅與ExpandableListActivity窗口功能FEATURE_LEFT_ICON不工作

我不使用的佈局,雖然我沒有嘗試這個帶佈局,它仍然無法正常工作。在正常的Activity子類中正常工作,我沒有看到問題是什麼。

public void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    requestWindowFeature(Window.FEATURE_LEFT_ICON); 
    setFeatureDrawableResource(Window.FEATURE_LEFT_ICON,R.drawable.ic_launcher); 

使用FEATURE_NO_TITLE的效果很好。是什麼賦予了?任何人有任何建議?

+0

見https://groups.google.com/forum/?fromgroups=#!topic/android-developers/G_5MAq8v4jc – 2013-04-04 07:35:12

回答

4

試試這個代碼...

requestWindowFeature(Window.FEATURE_LEFT_ICON); 
setContentView(R.layout.main); //or whatever layout is shows 
setFeatureDrawableResource(Window.FEATURE_LEFT_ICON,R.drawable.ic_launcher);