How to change the background color of uiradiobuttons?
I have a few uibuttongroups in my app and to distinguish them visually I want to apply different background colors to them. But the radiobuttons’ backgroundcolor can’t be changed so the whole setup looks a bit weird.
Here is a sample code:
fig=uifigure;
bg=uibuttongroup(fig,’BackgroundColor’,[0.8 0.9 1],’Position’,[100 100 150 150]);
rb1=uiradiobutton(bg,’Text’,’Previous’,’Position’,[10 100 75 20]);
rb2=uiradiobutton(bg,’Text’,’Next’,’Position’,[10 50 75 20]);
%rb1.BackgroundColor=[0.8 0.9 1]; %Won’t work!
In addition, the default background grey of uibuttongroup & uiradiobutton are slightly different in R2025a so even with the default colours, it feels like something is off!I have a few uibuttongroups in my app and to distinguish them visually I want to apply different background colors to them. But the radiobuttons’ backgroundcolor can’t be changed so the whole setup looks a bit weird.
Here is a sample code:
fig=uifigure;
bg=uibuttongroup(fig,’BackgroundColor’,[0.8 0.9 1],’Position’,[100 100 150 150]);
rb1=uiradiobutton(bg,’Text’,’Previous’,’Position’,[10 100 75 20]);
rb2=uiradiobutton(bg,’Text’,’Next’,’Position’,[10 50 75 20]);
%rb1.BackgroundColor=[0.8 0.9 1]; %Won’t work!
In addition, the default background grey of uibuttongroup & uiradiobutton are slightly different in R2025a so even with the default colours, it feels like something is off! I have a few uibuttongroups in my app and to distinguish them visually I want to apply different background colors to them. But the radiobuttons’ backgroundcolor can’t be changed so the whole setup looks a bit weird.
Here is a sample code:
fig=uifigure;
bg=uibuttongroup(fig,’BackgroundColor’,[0.8 0.9 1],’Position’,[100 100 150 150]);
rb1=uiradiobutton(bg,’Text’,’Previous’,’Position’,[10 100 75 20]);
rb2=uiradiobutton(bg,’Text’,’Next’,’Position’,[10 50 75 20]);
%rb1.BackgroundColor=[0.8 0.9 1]; %Won’t work!
In addition, the default background grey of uibuttongroup & uiradiobutton are slightly different in R2025a so even with the default colours, it feels like something is off! appdesigner, uiradiobuttons MATLAB Answers — New Questions