简体   繁体   English

如何在Xamarin.Android中为导航抽屉的菜单项赋予颜色

[英]How to give color to menu items for Navigation drawer in Xamarin.Android

I have a Navigation Drawer in my Xamarin.Android app, it's menu items have icons that are coloured but when i run, they are greyed. 我的Xamarin.Android应用程序中有一个导航抽屉,它的菜单项带有带颜色的图标,但是当我运行时,它们呈灰色。

After searching on Stack, i've found ou that this is coursed by tinting - but all question handle how to disabling tinting in standard android projects. 在Stack上搜索后,我发现ou这是通过着色进行的-但所有问题都涉及如何在标准android项目中禁用着色。 How do I achieve this in Xamarin.Android 如何在Xamarin.Android中实现此目标

Try: 尝试:

navView.ItemIconTintList = null;

Note : If you are familiar with the Android SDK, to get an equivalent method in Xamarin.Android (usually) is matter of removing the set/get from the name as this is converted to a C# property. 注意 :如果您熟悉Android SDK,则在Xamarin.Android中获取等效方法(通常)通常是从名称中删除set / get,因为它将转换为C#属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM