我在文件中声明HorizontalTextAlignment = TextAlignment.Start
正确放置,但它不起作用
Entry txtNifContribuinte = new RoundedEntry
{
IsEnabled = false,
TextColor = Color.Black,
HorizontalTextAlignment = TextAlignment.Start,
HeightRequest = 40
};
更新
现在,HorizontalTextAlignment
和VerticalTextAlignment
属性正常工作,并且删除了XAlign
和YAlign
。
原答案:
水平文本对齐是Xamarin和.Net历史上最具误导性的属性(开玩笑)
要对齐文本,应使用 XAlign
属性。
像这样的东西
XAlign="Start"
顺便说一句,我很好奇RoundedEntry
是什么!!
假设它是一个自定义条目,你应该像这样使用它
RoundedEntry entry= new RoundedEntry();