输入组件在Xamarin表单上填充屏幕

时间:2016-09-28 11:30:06

标签: xamarin xamarin.forms

我需要使Entry和Picker字段水平填充屏幕。

我尝试过任何可能的Horizo​​ntalOptions但没有成功。

我的代码如下;

<StackLayout Orientation="Horizontal"  HorizontalOptions="FillAndExpand">
    <StackLayout Orientation="Vertical">
        <Entry x:Name="ReceiverIBANTextField"  Placeholder="Alıcı IBAN" Keyboard="Numeric">  </Entry>
        <Entry x:Name="ReceiverFullNameTextField"  Placeholder="Alıcı Ad Soyad" >  </Entry>

        <StackLayout Orientation="Horizontal">
            <Entry x:Name="EntryTransferAmount"  Placeholder="Tutar Giriniz" Keyboard="Numeric" VerticalOptions="FillAndExpand"/>
            <Label x:Name="LabelCurrencyName" Text="$" />   
        </StackLayout>
        <StackLayout Orientation="Horizontal">
            <StackLayout HorizontalOptions="FillAndExpand">
                <Label TextColor="#0099DC">Tümünü Aktar </Label>
            </StackLayout>                      

            <StackLayout HorizontalOptions="Fill" >
                <Switch x:Name="SwitchForAllInForVirman" Toggled="SwitchForAllIn_Toggled" HorizontalOptions="End"/>
            </StackLayout>                                          
        </StackLayout>

        <StackLayout Orientation="Vertical" HorizontalOptions="FillAndExpand" >

            <Entry x:Name="EntryDescriptionForVirman" Placeholder="Açıklama Giriniz"></Entry>           
            <Picker x:Name="PickerPaymentType" Title="Ödeme Tipi" ></Picker>
            <Entry x:Name="QuickTransactionNameTextField"  Placeholder="Hızlı İşlem Adı"></Entry>
        </StackLayout>
    </StackLayout>                      
</StackLayout>      

1 个答案:

答案 0 :(得分:1)

我在示例项目中尝试了您的代码,您还需要将第二个StackLayout的HorizontalOptions设置为FillAndExpand才能生效。