问题描述
我试图使用从库项目派生的所有应用程序相同的应用程序图标。
I am trying to use the same application icon for all applications derived from a Library Project.
我想,这将是作为实现所提供的意见in这个线程,但遗憾的是它不工作。
I thought that it would be as simple as implementing the advice provided in this thread, but unfortunately it doesn't work.
我所做的是添加到<清单>
标签在应用程序的的AndroidManifest.xml
以下行
What I did is add to the <manifest>
tag in the application's AndroidManifest.xml
the following line:
xmlns:mylib="http://schemas.android.com/apk/res/com.example.baseapp"
和几行上下一致的AndroidManifest.xml
文件,更改典型 @绘制/图标
来:
And a few lines down the same AndroidManifest.xml
file, change the typical @drawable/icon
to:
<application android:icon="@mylib:drawable/icon">
不过,这是行不通的!
But it doesn't work!
相反,Eclipse的告诉我说:
Instead, Eclipse tells me that:
错误:错误:没有资源的发现,
匹配给定的名称(在图标与
值@omlib:绘制/图标。)
显然,从布局XML和清单的XML引用可绘是不一样的。
Apparently, referencing drawables from a layout XML and the manifest XML are not the same.
如何在应用程序的AndroidManifest.xml中引用的图标从图书馆计划?
How do I reference an icon from a Library Project in Application's AndroidManifest.xml?
推荐答案
您是否尝试过只绘制/图标?我不知道你的设置,但它为我工作。
Did you try with drawable/icon only ? I don't know about your setup but it works for me.
后,也许一个好的项目和librairy清理...
Perhaps after a good project and librairy clean up...
这篇关于如何从图书馆工程应用的AndroidManifest.xml中引用的图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!