Xamarin输入字段(iOS)-右对齐文本

mtb9vblg  于 2022-12-07  发布在  iOS
关注(0)|答案(1)|浏览(140)

I am trying to create <Entry> field with HorizontalTextAlignment="End" . When typing more than one word (ex: Burger King), hitting the spacebar between the words does nothing. Once you hit the "K" in King, it will add the space and register the K. This behavior only happens on iOS from what I can tell.
I have tried OnTextChanged Invalidating the size hoping this would redraw the input, but this was not working for me.
Any help would be appreciated.
Here is an example of the code I am working with.

<StackLayout 
    VerticalOptions="Center">
    <!-- Place new controls here -->
    <Label Text="Merchant" 
           VerticalOptions="CenterAndExpand" />
    <Entry 
        HorizontalOptions="EndAndExpand"
        HorizontalTextAlignment="End"
        Placeholder="Name" 
        PlaceholderColor="Black"></Entry>
</StackLayout>
sqserrrh

sqserrrh1#

我在Xcode上重现了你的问题,Forms中的Entry控件对应iOS的原生UITextField,在Xcode上,我使用UITextField将文本右对齐并点击空格,但无法显示,所以这不是Forms的问题,它是iOS的原生问题。

相关问题