输入的水平文本对齐方式不起作用



我在文件中声明HorizontalTextAlignment = TextAlignment.Start正确放置,但它不起作用

Entry txtNifContribuinte = new RoundedEntry 
{ 
    IsEnabled = false, 
    TextColor = Color.Black, 
    HorizontalTextAlignment = TextAlignment.Start, 
    HeightRequest = 40 
};

更新

现在,HorizontalTextAlignmentVerticalTextAlignment属性正常工作,并且删除了XAlignYAlign

原答案:

水平文本对齐是Xamarin和.Net历史上最具误导性的属性(开玩笑)

要对齐文本,应使用 XAlign 属性。

像这样的东西

XAlign="Start"

顺便说一句,我很好奇RoundedEntry是什么!!

假设它是一个自定义条目,你应该像这样使用它

RoundedEntry entry= new RoundedEntry();

最新更新