ログイン画面が期待どおりに動作していません。サインインボタンを最初にタップすると、ソフトキーボードが閉じられるだけで、ボタンによってイベントが発生することはありません。したがって、ログインするには、ユーザーはもう一度ログインボタンをアプリする必要があります。
これは私には正しくないようですが、これが予想される動作であるかどうかを把握しようとしているので、キーボードを手動で閉じる必要があるかもしれません。または、これを却下して、Formsによってイベントを渡す必要がある場合。
問題のサンプルを含むリポジトリは次のとおりです:https://github.com/GiusepeCasagrande/ScrollLoginBug
サインインボタンはキーボードによってブロックされています。ユーザーがサインインボタンをタップする唯一の方法は、キーボードを閉じてからボタンをタップすることです。
実装しようとしているUIについて説明する場合は、回答を編集してコードを提供します。
サインインボタンをタップするためにパスワードを入力した後にユーザーが2回クリックしなければならない理由は、の中にGrid
ネストされているためですStackLayout
。を削除した後Grid
、ユーザーはできる
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="ScrollLoginTest.ScrollLoginTestPage"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:ScrollLoginTest">
<ContentPage.Content BackgroundColor="{DynamicResource defaultBackgroundColor}">
<ScrollView x:Name="LoginScrollView" BackgroundColor="{DynamicResource defaultBackgroundColor}">
<StackLayout Orientation="Vertical" Padding="40">
<Grid VerticalOptions="CenterAndExpand">
<Grid.RowDefinitions>
<RowDefinition Height="60" />
<RowDefinition Height="60" />
<RowDefinition Height="60" />
</Grid.RowDefinitions>
<Entry x:Name="Server"
Grid.Row="0"
Grid.Column="0"
VerticalOptions="End"
AutomationId="LoginView_Server"
Keyboard="Url"
Placeholder="Server"
Style="{DynamicResource regularEntry}" />
<Entry x:Name="UserName"
Grid.Row="1"
Grid.Column="0"
VerticalOptions="End"
AutomationId="LoginView_UserName"
Keyboard="Email"
Placeholder="UserName"
Style="{DynamicResource regularEntry}" />
<Entry x:Name="Password"
Grid.Row="2"
Grid.Column="0"
VerticalOptions="End"
AutomationId="LoginView_Password"
IsPassword="true"
Placeholder="Password"
Style="{DynamicResource regularEntry}" />
</Grid>
<Grid VerticalOptions="EndAndExpand">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width=".20*" />
<ColumnDefinition Width=".6*" />
<ColumnDefinition Width=".20*" />
</Grid.ColumnDefinitions>
<Button x:Name="LoginButton"
Grid.Row="0"
Grid.Column="1"
AutomationId="LoginView_SignIn"
Style="{DynamicResource blueButton}"
Text="SignIn" />
</Grid>
</StackLayout>
</ScrollView>
</ContentPage.Content>
</ContentPage>
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="ScrollLoginTest.ScrollLoginTestPage"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:ScrollLoginTest;assembly=ScrollLoginTest">
<ContentPage.Content BackgroundColor="{DynamicResource defaultBackgroundColor}">
<ScrollView x:Name="LoginScrollView" BackgroundColor="{DynamicResource defaultBackgroundColor}">
<StackLayout Padding="40">
<Entry x:Name="Server"
VerticalOptions="End"
AutomationId="LoginView_Server"
Keyboard="Url"
Placeholder="Server"
Style="{DynamicResource regularEntry}" />
<Entry x:Name="UserName"
VerticalOptions="End"
AutomationId="LoginView_UserName"
Keyboard="Email"
Placeholder="UserName"
Style="{DynamicResource regularEntry}" />
<Entry x:Name="Password"
VerticalOptions="End"
AutomationId="LoginView_Password"
IsPassword="true"
Placeholder="Password"
Style="{DynamicResource regularEntry}" />
<Button x:Name="LoginButton"
AutomationId="LoginView_SignIn"
Style="{DynamicResource blueButton}"
Text="SignIn" />
</StackLayout>
</ScrollView>
</ContentPage.Content>
</ContentPage>
GitHubでソリューションのプルリクエストを開きました:https://github.com/GiusepeCasagrande/ScrollLoginBug/pull/1
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加