[徽标/图标在使用Theme.Material.Light时丢失

问题描述 投票:4回答:1

我必须针对新的Material设计自定义我的应用,但看起来Android将该图标拖放到了左上角的操作栏中。我不能只放下我的品牌图标。有什么办法可以添加吗?我在Android 5的res文件夹中的values-v21中使用以下样式。

<style name="AppTheme" parent="android:Theme.Material.Light">

好的,我从here知道了您要做的就是:

ActionBar ab = getActionBar();
ab.setDisplayHomeAsUpEnabled(false);
ab.setHomeButtonEnabled(true);
ab.setIcon(R.drawable.icon);
ab.setDisplayShowHomeEnabled(true);
android-actionbar android-5.0-lollipop android-theme
1个回答
0
投票

[Theme.Material.Light此主题不支持在操作栏中显示App图标。

© www.soinside.com 2019 - 2024. All rights reserved.