How to resize the app window screen in Matlab app designer?
8 次查看(过去 30 天)
显示 更早的评论
I am working with Matlab app designer. whenever i run the app, i want it to automatically open in a full screen mode just like any other app. How do I do it?
0 个评论
采纳的回答
Ameer Hamza
2020-6-14
Create the startup Function for your figure window and use the following code inside it
function startupFcn(app)
units = get(groot, 'Units'); % backup Units
set(groot, 'Units', 'pixels');
app.UIFigure.Position = get(groot, 'ScreenSize');
set(groot, 'Units', units); % restore original units
end
See the attached app.
3 个评论
Ameer Hamza
2020-6-20
I found that there is no need to set the Position property. You can get the same effect by maximizing the window. Also, add some delay so that all the components are loaded before maximizing the window
function startupFcn(app)
pause(1);
app.UIFigure.WindowState = 'maximized';
end
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
