Reputation: 1479
I have a very simple component which, to my surprise, is rendered differently on different platforms despite being hosted inside a BlazorWebView
.
On Windows, its rendered as expected. On Android, however, the text is not centered. How is this possible? I do not believe I have any platform-specific code.
And is it possible to resolve this issue, and get consistent output on both/all platforms?
The component:
<div Style="height:250px;background-color:coral;align-content: center;">
<p style="text-align: center;">No items</p>
</div>
I have also re-created the component in MudBlazor here (same result): https://try.mudblazor.com/snippet/cumIbaGmMclCKdsj
Windows rendering:
Android rendering:
Upvotes: 0
Views: 109
Reputation: 13899
Yes, it is just the case as user1202032 said.
But we can use the following workaround:
<div Style="display:flex;height:250px;background-color:coral;">
<p style="flex-grow: 1;text-align: center;align-self: center;">No items</p>
</div>
And we can check the following issue to get more information: MAUI Blazor Hybrid different rendering on different platforms.
Upvotes: 0