필터 지우기
필터 지우기

image not showing in front of button

조회 수: 1 (최근 30일)
Quy
Quy 2023년 12월 12일
댓글: Voss 2023년 12월 19일
I have an appdesigner app. It is designed with grids. There is a grid with two columns. The right column of the grid is 10x wider than the left. There is a button that spans both the left and right grid. There is also an image on the left column of a "play" image.
When the app is initialized, I am expecting the image to be shown on top of the button, but it is not. Why?
For more information, this was working fine about an hour ago. I was in the middle of editing some code in appdesigner code editor, and then appdesigner just crashed. WTF? and since then, I am unable to see the image. Two images attached shows my Design View and the app once it is started (the one with the yellow question mark). I have tried: delete and added component back, making sure the path is correct... nothing seems to work. Any help is appreciated.
  댓글 수: 2
Image Analyst
Image Analyst 2023년 12월 13일
No idea unless we can try it ourselves. Can you attach the .mlapp file and the green triangle image?
Quy
Quy 2023년 12월 13일
Attached is a cpoy of the orignal mlapp, but with most codes deleted. The issue is still present.
I also attached an app1.mlapp file. It works as I would like it to work.

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

채택된 답변

prabhat kumar sharma
prabhat kumar sharma 2023년 12월 19일
Hello Quy,
I understand that you're facing issue with displaying an icon inside a button.
One possible solution to your problem is to incorporate the play icon directly into the button, rather than using it as a separate image in the left grid. To do this, upload your play image to the button's `Icon` property and set the `IconAlignment` property to leftmargin
.
I hope this resolves the issue.
  댓글 수: 5
Quy
Quy 2023년 12월 19일
This is the summary of the issue (summarizes from the original post): Have a grid with two column. In this grid is a button that spans both column. However, the left column also have an image. The image is supposed to be on top, but it disappears when the app is actually running.
The "workaround" to the original issue is to use the icon property of the button instead of having an additional image. And this "workaround" should be the primary way and should be done for this type of problem, and not to use an image.
Now, it "still does not solved whatever is going on" means that if I actually use a separate image for the icon instead of the button icon property, the problem is there. But I am not going to do that anymore, because to me using the icon property is the right way to go.
Voss
Voss 2023년 12월 19일
Ah, I see. Thank you for clarifying.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by