1

當用戶在Xamarin.Form鍵盤打開,但查看滾動所以設計看起來醜陋的用戶焦點入口控制,請幫助我。 我已經把圖像如何在Android設備中打開鍵盤時可見。 下面查看滾動鍵盤打開時輸入控制

<StackLayout Grid.Row="1"> 
     <StackLayout Padding="20,10,20,20" > 
      <Entry x:Name="Txtusername" Placeholder="Name"/> 
      <Entry x:Name="TxtPass" 
        IsPassword="True" 
        Placeholder="Password" /> 
      <StackLayout Padding="0,10"> 
       <Button x:Name="BtnSign" 
         BackgroundColor="#FFFFCB04" 
         BorderColor="#FFFFCB04" 
         Clicked="BtnSignInClicked" 
         Text="Sign In" 
         TextColor="Black" /> 
      </StackLayout> 
     </StackLayout> 
    </StackLayout> 

Before keyboard open

After keyboard open

+0

你有沒有嘗試過使用Grids做這種佈局? XF佈局仍然像公共測試版那樣。選擇不同的佈局控件有時可以解決問題。 – Dbl

回答

0

添加WindowSoftInputMode=SoftInput.AdjustPan我的代碼給你[Activity()]您MainActivity類別的頂部從哪裏開始FormsApplication。

這樣,當鍵盤處於活動狀態時,您的佈局不會改變。我想你不需要在這裏滾動。如果你想滾動然後在你的代碼中添加滾動視圖

<ScrollView> 
.//your grid 
. 
    <StackLayout Grid.Row="1"> 
     <StackLayout Padding="20,10,20,20" > 
      <Entry x:Name="Txtusername" Placeholder="Name"/> 
      <Entry x:Name="TxtPass" 
        IsPassword="True" 
        Placeholder="Password" /> 
      <StackLayout Padding="0,10"> 
       <Button x:Name="BtnSign" 
         BackgroundColor="#FFFFCB04" 
         BorderColor="#FFFFCB04" 
         Clicked="BtnSignInClicked" 
         Text="Sign In" 
         TextColor="Black" /> 
      </StackLayout> 
     </StackLayout> 
    </StackLayout> 
</ScrollView>