- Ensure that "cellxica.png" is not corrupted.
- Ensure that your "cellxica.png" file is located in the same directory as your "app.mlapp" file.
- Remember to include this directory in your MATLAB path.
Icon not appearing in app
35 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Peter
el 10 de Abr. de 2024
Respondida: Peter
el 1 de Mayo de 2024
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](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1665271/App%20body.png)
CatedemoUIFigure settings
![Settings](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1665276/Settings.png)
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 comentarios
Respuesta aceptada
Más respuestas (2)
prabhat kumar sharma
el 14 de Abr. de 2024
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!
Ver también
Categorías
Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!