操作栏程序图标与Android失踪5图标、操作、程序、Android

2023-09-05 06:10:26 作者:君影绰绰,从此陌路

只需使用Android SDK 5和相关appcompat重建我的应用程序。

Just rebuilt my app using the Android 5 SDK and associated appcompat.

看起来工作得很好,但我的应用程序图标不再在左上角显示。打开导航抽屉的图标是有,但没有图标。

Seems to work fine but my app icon is no longer showing in top left hand corner. The icon to open nav drawer is there but no icon.

什么办法解决这一问题?

Any way to fix this?

推荐答案

使用code下面的onCreate:

Use the code below in onCreate:

getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setLogo(R.drawable.ic_launcher);
getSupportActionBar().setDisplayUseLogoEnabled(true);