App Designer - elements in radio button group change position on opening app designer
16 views (last 30 days)
Show older comments
I have an app that has a radio button group that is added to a grid layout. Every time I open App Designer, the buttons (and text) within the radio button group change position. More specifically, the buttons shift down (the bottom value for each button decreases by 4).
This isn't necessarily an error, but it's driving me nuts because the buttons shift down and eventually I have to manually move them back up after a couple days. I'm not sure if it's the way App Designer is initializing or if this is some kind of setting I need to change in MATLAB. It seems like App Designer is running some auto-formatting routine at the end of initialization because after opening up App Designer I see that it has made changes (via the *) without me touching anything.
More details:
- App Designer opens on my main laptop screen (1920x1200)
- This happens regardless of whether I move the App Designer instance to a different screen or not
- I've tried changing some of the radio button group properties, but nothing seems to fix the issue.
1 Comment
Mario Malic
on 9 Jun 2024
Try to remove and then add the component, maybe this will work. Otherwise, contact support so they fix your file.
Answers (1)
Ayush Singh
on 10 Jun 2024
Hey Garrett,
As far as I can understand the issue you are facing is in position of radio buttons.
While there is no straightforward "setting" in MATLAB that controls this kind of behavior, here are some considerations that might help mitigate or understand the issue better:
- Since the issue persists regardless of the screen App Designer is on, it might not be directly related to screen resolution or DPI (dots per inch) settings. However, MATLAB GUI components can sometimes behave unexpectedly due to high DPI settings or scaling factors set in the operating system. If you have not already, try setting your display scaling to 100% to see if that stabilizes the behavior. This is especially relevant if your laptop or monitors have high pixel density.
- As a workaround, you could consider adding a startup function to your app that programmatically resets the positions of the radio buttons to your desired coordinates. This is not an ideal solution, as it does not address the root cause, but it could serve as a temporary fix.
% Inside your app startup function
% Assuming you have a radio button group named 'radioButtonGroup'
% and individual buttons named 'rb1', 'rb2', etc.
% Here Position is the property of radio button
app.rb1.Position(2) = desiredYPosition1;
app.rb2.Position(2) = desiredYPosition2;
% Set the positions for each button as needed
Also if possible can you share the code to reproduce the issue if above workarounds do not work.
See Also
Categories
Find more on Migrate GUIDE Apps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!