Now what I want is as the background color of other layouts is pink the selected menu item on the navigation bar should also be pink (I mean the text color and the icon should be pink) like this :Ĭan anyone please tell how to achieve it programatically in code as I have to change selected text and icon colors at runtime randomly.įirstly thank you all for responding back with your solutions :) Learning from the answers above and doing some research on ColorStateList I finally managed to create a method which sets the color of the checked item on the navigation drawer to match the color of my app theme color which is generated randomly at runtime. ( 'FontColor', false, Color.Red) it does not working. thank you Use setdata function and pass the role as background role or text role. Now everything is going fine except the color of the selected menu item on navigation drawer is still blue. the default selected background color of QTreeWidgetItem is dark-blue, i want to remove this background color and just set a red rectangle for the selected item. ![]() One of the requirements of this app is to change the background colors of layouts (including navigation drawer header color) randomly at run time. ![]() ![]() Using android's default Navigation drawer activity I am developing an application.
0 Comments
Leave a Reply. |