ActionBar官方教程(3)更改标题处的图片

时间:2021-08-01 17:42:47

Using a logo instead of an icon

  By default, the system uses your application icon in the action bar, as specified by the icon attribute in the<application> or <activity> element. However, if you also specify the logo attribute, then the action bar uses the logo image instead of the icon.

  A logo should usually be wider than the icon, but should not include unnecessary text. You should generally use a logo only when it represents your brand in a traditional format that users recognize. A good example is the YouTube app's logo—the logo represents the expected user brand, whereas the app's icon is a modified version that conforms to the square requirement for the launcher icon.

  如果在minifest.xml中指定了logo,ActionBar就不用icon而用它.
 <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:logo="@drawable/ab_me_l"
        android:label="@string/app_name"
        android:theme="@style/AppBaseTheme" > ...