how to remove margins in cross-platform Andriod app? #21068
Replies: 3 comments
-
|
These margins are really strange. Please try with a very minimal sample to reproduce. Also make sure you have the latest Avalonia version. |
Beta Was this translation helpful? Give feedback.
-
|
Did you set a fixed width height somewhere? |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for your replies. I was able to get it sorted out. That said, the behavior was strange. I looked again at app.axaml.cs and saw that desktop used MainWindow.axaml and the mobile platforms used MainView.axaml. In MainWindow, for the Window, I added SizeToContent="WidthAndHeight" and set the inclusion of MainView to Stretch for both horizontal and vertical alignment parameters. Then in MainView I set the UserControl horizontal and vertical alignment parameters to Stretch and set the MinHeight and MinWidth to my Desigh Height and Width. I also made sure that all the remaining UserControls that are intended to be full screen did not have any sizes defined, other than DeskghHeight and Width. After making all of the above changes, the unwanted margins were removed from Android window. A suggested enhancement could be to add comments to the code that is generated from the template that suggest how to avoid this for other newbs. Thanks again! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
The subject line says it all.
I am creating a cross platform app. When I run the app in the Android Emulator, there are wide margins around the application. I would like it to be stretched to the edge of the screen. According to what I have read, this is supposed to be the behavior.
I have included a screenshot that shows both the Desktop and Android windows and the different behavior.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions