2014-07-01 79 views

回答

1

那 「東西」 是homeasupindicator圖標。您可以在styles.xml文件中更改它,方法是自定義主題,修改android:homeAsUpIndicator屬性。

在您的Manifest.xml中,您可以爲整個應用程序或每個Activities定義您的Theme

所以,一個樣式添加到您的styles.xml,像這樣:

<style name="Theme.MyCustomTheme" parent="android:Theme.Holo"> 
<item name="android:homeAsUpIndicator">@drawable/my_indicator_drawable</item> 

然後,在你的Manifest.xml,做到:

android:theme="@style/Theme.MyCustomTheme" 

這將覆蓋ActionBar上的圖標。 不要忘記打電話給getSupportActionBar().setDisplayHomeAsUpEnabled(true);激活圖標行爲。

+0

最後,我一直在尋找這個'東西'的實際名稱。謝謝,我會在稍後的代碼。 –

+0

順便說一句,我在哪裏可以得到這個可繪製的圖標?我無法從developer.Android.com站點的Action Bar圖標包中找到它。 –

+0

@Martin Ongtangco你可以在這裏找到並下載原始圖標:http://romannurik.github.io/AndroidAssetStudio/icons-nav-drawer-indicator.html#theme=light&color=33b5e5%2C40 – joao2fast4u