2013-03-22 73 views

回答

0

我指出瞭如何做到這一點。

GDActivity使用特殊的佈局結構:

<?xml version="1.0" encoding="utf-8"?> 

<view 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     class="greendroid.widget.ActionBarHost" 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     android:id="@+id/gd_action_bar_host"> 

    <view 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      class="greendroid.widget.ActionBar" 
      android:id="@+id/gd_action_bar" 
      /> 

    <FrameLayout 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:id="@+id/gd_action_bar_content_view"/> 
</view> 

所以,當我們按照邏輯,我們應該設置背景圖片的內容視圖幀,對不對?

但事實並非如此。

這不是工作:

Drawable mBackgroundDrawable = getResources().getDrawable(R.drawable.splash); 
getContentView().setBackgroundDrawable(mBackgroundDrawable); 

我們必須使用標準訪問窗口。

Drawable mBackgroundDrawable = getResources().getDrawable(R.drawable.splash); 
getWindow().setBackgroundDrawable(mBackgroundDrawable); 

任何更正將不勝感激。