Android的:如何改变动作条"家"图标为比应用程序图标的东西等?图标、应用程序、动作、东西

2023-09-12 01:33:46 作者:有种偏执叫唯爱你"

我的应用程序的主图标包含在一个图像两个部分:一个标志和它下面的几个字母。这非常适用于为应用程序的启动器图标,但是当图标上的动作条的左边出现,信件会被裁切,它看起来并不好。

My application's main icon consists of two parts in one image: a logo and a few letters below it. This works well for the launcher icon for the app, but when the icon appears on the left edge of the ActionBar, the letters get cut off and it doesn't look good.

我想提供的ActionBar带有图标的独立版本,只有标志的一部分,而不是字母下方,但到目前为止已经来了空。老实说,我找不到任何答案,我甚至不能找到问题本身的任何地方。

I would like to provide the ActionBar with a separate version of the icon, with only the "logo" part and not the letters beneath it, but so far have been coming up empty. I honestly can't find any answer to this, and I can't even find the question itself anywhere.

推荐答案

在ActionBar将使用android:logo您的清单中的属性,如果已提供。这使您可以使用不同的绘制资源的图标(发射器)和标识(动作条,除其他事项外)。

The ActionBar will use the android:logo attribute of your manifest, if one is provided. That lets you use separate drawable resources for the icon (Launcher) and the logo (ActionBar, among other things).