抽屉图标颜色

时间:2018-06-28 13:16:30

标签: android navigation-drawer android-toolbar

因此,我发现了很多类似问题的帖子,并且通过在工具栏样式中添加此行return userRepository.findByEmail(userDto.getEmail()) //rethrow DB errors as BadRequestException, except user exists .onErrorResume(t -> Mono.error(new BadRequestException())) //throwing in map is converted to onError signal .map(ifItGoesThereItExist-> { throw new UserByEmailExistException(); }) //switchIfEmpty to replace an empty source with a different Mono .switchIfEmpty(createUser(userDto)) //at this point, map can only receive an onNext from the createUser .map(u -> new ResponseEntity(u, HttpStatus.CREATED)) ; 来更改抽屉图标的颜色,但是要使其正常工作,我需要将此行添加至工具栏xml {{1 }},但是代码中的样式发生了变化,并且在更改主题后该工具栏将选择原色,但我无法在工具栏xml中使用<item name="colorControlNormal">@android:color/white</item>,所以我想知道是否可以在样式中设置工具栏主题吗?

我尝试了这个,但还是没有结果

我通过编程方式设置的主题

android:theme="@style/ToolbarStyle"

工具栏样式,当我将主题更改为我的主题时必须应用于工具栏

android:theme

工具栏xml

<style name="mytheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:toolbarStyle">@style/ToolbarStyle</item>
</style>

1 个答案:

答案 0 :(得分:0)

因此,在使用样式后,我想出了解决方法,而不是将这行<item name="colorControlNormal">@android:color/white</item>添加到工具栏样式中,而是将其添加到mytheme样式中,并且可以正常工作

相关问题