I am using uicontrol to create GUI Elements. Following is my Code
uicontrol('Style','pushbutton', 'String','Load data','Parent',hTabs(1),'Position',[250 825 80 20], 'Callback',@ButtonCallback);
Here the problem is when i am using Units normalized option the GUI element is disappearing from Screen. I want to use normalized so that GUI adjusts itself in different screen resolutions. Any idea on this would be very helpful for me.
When you use
Normalizedunits you need to define the position between 0 and 1, with 0 being the bottom/left hand side and 1 being the total height/width of the containing object.You are currently defining the position using numbers that are well out of this range. You can do two things.
normalizedin seperate function call (demonstrated below)uicontrolwith normalized units, but you’ll have to calculate the proper position vectorHere are examples on how to do either
A simple solution is to create the
uicontroland then set the units to normalized in a separate callIf you want to get the position vector in normalized units
Then use these numbers to create the
uicontrolwith normalized units: