.NET MAUI - HorizontalTextAlignment="Center" is not working on Android - xaml

I've converted a project from Xamarin to .Net MAUI. MAUI has many issues, but one of the most annoying is the fact that HorizontalTextAlignment set to Center is not working in Android. For labels that are only a single line the regular HorizontalAlignment is working, but for multiple line labels it is not a working solution:
In the screenshot the two header labels are centered using HorizontalAlignment on the VisualElement, but for the longer text below this is not working. Event though the label element is centered, the text inside is not center aligned.
Does anyone have a solution?
P.S. HorizontalTextAlignment is working in iOS, and it is also working in my Android emulator when I manipulate it in Hot Reload.

Turns out this was an issue because I upgraded a xamarin project to Maui. Somehow in the android mainifest the value android:supportsRtl="true" is then not set on the application element like this:
<application android:networkSecurityConfig="#xml/network_security_config" android:icon="#mipmap/icon" android:label="YourAppName" android:supportsRtl="true">
Thanks to #ewerspej

Related

Xamarin TabbedPage without shadow on android

I created a really simple TabbedPage on my project and i set the BarBackground to the same color of the other pages but the bar has a shadow that i want to remove but i don't know how to do it. I tried to set the BarBackground to "Transparent" but doesn't work or i just don't know how to set properly. I know on IOS there's a way but i couldn't find on android.
My TabbedPage:
<local:Hub IconImageSource="checklist.png"></local:Hub>
<local:Home IconImageSource="home.png"></local:Home>
<local:ChartView IconImageSource="charthistogram.png"></local:ChartView>

Xamarin Title bar text centered (Cross-platform)

I've been working on this project, and its really been bothering me. I have this issuse where I can easily add text to my title bar, but i can't center it. All my code is written in either XAML / MVVM. The thing is, it needs to be cross-platform, So far i've only found guides how to do it specific for android devices.
Heres is the example of my title bar right now. I want to center that text. I hope anyone can help.
It is centered by default on iOS and you would need to add a custom binding I guess to add the Android specific code for centering it.

Storyboard not rendering added views

I am trying to execute the steps described in iOS developer library basics tutorial. When I add "Scene to story board" run the simulator, I am not seeing the label. It is just white screen. Not sure what is causing this issue. Any suggestions?
Environment:
iOS SDK7.1
XCode 6.0
Rented server machine from MacInCloud.
EDIT:
Here is snap shot of my Xcode:
When I use "Single View Application" template, "Views" I am adding to story board are showing up properly in simulator.
It could be that the positioning of the label is outside of the visible screen. One quick way to rectify this would be to add a new Alignment Constraint so that the label is "Horizontal Center in Container". An example of how to add an Alignment Constraint below...
I thought to close this question first, but it seems not a good practice, so adding solution as answer.
I missed To configure the app delegate implementation file step from the documentation, which is why it is showing white screen. Make sure you delete the code which renders white background.

Progress Bar not working in WP8

I have a simple Progress Bar where IsIndeterminate="True". It's working fine in WP7 but not in WP8. All I see is one dot that doesn't scroll. I've read how the Progress Bar was included in a Toolkit which I should've used in WP7 for performance issues which I didn't (ooops) but running the app in WP8 shows just 1 dot on the screen. I've upgraded the project to WP8 as apparently the Progress Bar within the SDK is the best one to use yet I still have the problem. My xaml is as follows:
<ProgressBar HorizontalAlignment="Left" VerticalAlignment="Top" Width="300" IsIndeterminate="True"/>
Here is an image showing which reference package the Progress Bar is using from the Toolbox:
https://skydrive.live.com/redir?resid=93AA9A941DD84E76!3185&authkey=!AJOdQz3YPV8xEtY&v=3
Could I possibly be referencing a package that has an older implementation of the Progress Bar?
Any help would be great.
I found the problem. It was because I had my own copy of CustomThemeResources which had a WP7 definition of ProgressBar. I removed it and it works.

How do I position in mono for android?

Hello i am new to Mono for android. I am trying to make a Calculator, in a normal windows forms application.
I can Drag a button or textbox to any position I want but how does that work in Mono for android, I want the buttons next to each other not only downwards. If I place buttons under eachother that go out of the framework I dont want that either..
I am not English il hope you will understand.
please help.
Android "supports", but has deprecated and doesn't endorse, pixel-perfect layout. Unfortunately the Windows Forms-style of dragging and dropping controls onto a design surface at specific pixel locations requires pixel perfect layout, so you can see the mismatch here.
For a Calculator, what you would instead want to do use a Table Layout or some other "resizable" container, so that your Activity can support the variety of device sizes that Android covers.