iOSTextAlignment.Right Not Working?

It seems that the iOSTextAlignment.Right is not working. I do something like

g.DrawTextLine("This is a test", 0.0, 40.0, 500, iOSTextAlignment.Left, true)

And it still seems to center it left. The same if I use the DrawTextBlock method.

Do I need to do something differently or is it a bug?

[quote=170657:@FOTIS GEORGIADIS]It seems that the iOSTextAlignment.Right is not working. I do something like

g.DrawTextLine("This is a test", 0.0, 40.0, 500, iOSTextAlignment.Left, true)

And it still seems to center it left. The same if I use the DrawTextBlock method.

Do I need to do something differently or is it a bug?[/quote]

The code you posted should indeed align the text left. That is what you specify…

Sorry Michel, I meant I tried:

g.DrawTextLine("Right Justify Test", 250.0, 40.0, -1, iOSTextAlignment.Right, true)

It seems I copied the wrong line of code. But the thing is that it aligns left instead of right.

Currently, you have the max width set to -1. Using align right is like placing the text within a box, you need a width to that box for the type to align inside the right edge. You would also set the x position to the left edge of that imaginary box.

If you wanted the right edge of the type to land at 250, you would write

g.DrawTextLine("Right Justify Test", 0.0, 40.0, 250.0, iOSTextAlignment.Right, true)

Scott you were right. Thank you very much. I didn’t deduce this from the documentation!