我认为这与proguard有关;请参阅帖子底部的修改。分享按钮在导出应用后更改颜色
我使用eclipse来构建一个小的Android应用程序。
当我运行我的应用程序(通过点击Eclipse中的绿色运行按钮,用我的手机连接到由USB我的电脑),我的分享按钮看起来是这样的:
..这是我想要的。
当我文件 - >导出我的应用程序并安装使用adb install
的APK(或者如果我上传新的APK Play商店并安装更新),我的分享按钮看起来是这样的:
〜不幸。
如何让按钮在导出的应用程序中显示为白色?
从我的代码的某些代码段:
菜单项:
<item
android:id="@+id/menu_item_share"
android:title="@string/action_share"
mysapp:showAsAction="ifRoom"
myapp:actionProviderClass="android.support.v7.widget.ShareActionProvider" />
我RES /价值/ styles.xml:
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
<style name="vertical_space">
<item name="android:layout_marginTop">10dp</item>
</style>
资源/ VA梅毒-V14/styles.xml:
<!--
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
-->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- API 14 theme customizations can go here. -->
</style>
我也有一个parent="Theme.AppCompat.Light.DarkActionBar"
值-V11/styles.xml。我没有值-V21目录。
编辑1:
我试图想导出应用程序而不是只从Eclipse中运行它时,什么样的变化。
一种可能性是,我在project.properties
启用的ProGuard:导出时
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
Proguard的只有积极的,对不对?不知道这是否可以解释。
编辑2:
我在project.properties
注释掉proguard.config线和问题消失,即共享按钮导出该应用时是白色的。不过,我希望启用proguard。我怎样才能启用proguard并在导出时保持按钮为白色?
你能否提供apk的错误,指向保管箱或其他东西的链接? – gio 2014-12-17 17:40:38
@gio在我的用户页面中,您将看到一个Play商店链接,该链接指向带有黑暗分享按钮的应用版本。这有帮助吗? – Adrian 2014-12-18 10:59:55
它包含错误吗? – gio 2014-12-18 11:01:09