Icon not appearing in app

조회 수: 35 (최근 30일)
Peter
Peter 2024년 4월 10일
답변: Peter 2024년 5월 1일
Hi,
I am creating an app (for the first time) and the following is just a demo. I have defined an icon which appears in the button as you can see below. I'm also expecting it to appear on the top banner. I'm assuming that's what the settings were for.
App appearance
App body
CatedemoUIFigure settings
Settings
Code snippet for creation
% Component initialization
methods (Access = private)
% Create UIFigure and components
function createComponents(app)
% Get the file path for locating images
pathToMLAPP = fileparts(mfilename('fullpath'));
% Create CatedemoUIFigure and hide until all components are created
app.CatedemoUIFigure = uifigure('Visible', 'off');
app.CatedemoUIFigure.Position = [100 100 161 322];
app.CatedemoUIFigure.Name = 'Cate demo';
app.CatedemoUIFigure.Icon = fullfile(pathToMLAPP, 'cellxica.png');
app.CatedemoUIFigure.Tag = 'icon';
Code snippet after all components are created
% Show the figure after all components are created
app.CatedemoUIFigure.Visible = 'on';
Thank you.
  댓글 수: 3
Peter
Peter 2024년 4월 10일
Thank you for the reply.
The png is OK as it renders in the button.
It's definately in the same folder.
The path is included by the app designer and it is immutable.
% Get the file path for locating images
pathToMLAPP = fileparts(mfilename('fullpath'));
The top if the app only has the title and a close button. I was expecting a minimize and maximize too. Perhaps the place holder for the image is missing so it has nowhere to render it to?
Peter
Peter 2024년 4월 11일
It appears that I have misinterpreted which icon this is. It does apper as the image when doing Alt-Tab, switching between applications.
Every day is a school day.

댓글을 달려면 로그인하십시오.

채택된 답변

Peter
Peter 2024년 4월 11일
The icon is for displaying with Alt-Tab.

추가 답변 (2개)

prabhat kumar sharma
prabhat kumar sharma 2024년 4월 14일
Hi Peter,
If you'd like the same icon to appear in the top banner as well, you'll need to set the Icon property within the Identifier section of app.UIFigure.
Hope this helps!
  댓글 수: 1
Peter
Peter 2024년 4월 15일
Hi Prabhat,
Thank you for your reply. This is what I was expecting but only the applications icon is changed (e.g. alt-tab). The app designer does not give a minimise or maximise button on the top banner by default. There is a Matlab example...
f = msgbox("Operation Completed");
Which the demo should look like this...
Mine looks like this...
I'm using Matlab R2024a on Linux. The previous version did this too.
Thanks
Peter.

댓글을 달려면 로그인하십시오.


Peter
Peter 2024년 5월 1일
In Ubuntu, I had to use gnome-tweaks to enable the minimise and maximise button. So I now get this in MATLAB and all other Ubuntu apps!
Still no icon on the left hand side.

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품


릴리스

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by