2017-12-07 4 views
0

저는 Xamarin Forms의 최신 버전을 사용하고 있습니다. 콘텐츠 페이지가 있습니다. 내용 페이지에는 일부 이미지 및 입력 입력과 일부 버튼이 포함 된 스택 레이아웃이있는 scrollview가있는 표가 있습니다. 항목을 눌러 텍스트를 입력하면 키보드가 단추를 덮어서 단추를 누를 수 없습니다. 이것은 스크롤 할 수 없으며 이유를 알지 못합니다. 아무도 나 도와 줄 수 없어?Xamarin Forms : KeyBoard가있는 ScrollView

<?xml version="1.0" encoding="utf-8" ?> 
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" 
     xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
     x:Class="Spirocco.LoginPage"> 
<Grid> 
    <ScrollView Orientation="Both" x:Name="scrollView"> 
     <ScrollView.Content> 
      <StackLayout BackgroundColor="#302138"> 
       <Image Source="login_logo" Margin="0,0,0,0"></Image> 
       <StackLayout BackgroundColor="White" Margin="20,0,20,30"> 
        <Label Text="ÜDVÖZÖLJÜK!" FontSize="30" FontFamily="Comic Sans MS" Margin="0,15,0,0" TextColor="#302138" HorizontalTextAlignment="Center"></Label> 
        <Entry Text="{Binding Email}" Placeholder="E-mail" Margin="40,0,40,0" Keyboard="Email"/> 
        <Entry Text="{Binding Password}" Placeholder="Jelszó" IsPassword="True" Margin="40,0,40,0"/> 
        <Button Text="BEJELENTKEZÉS" Clicked="Login" TextColor="White" BackgroundColor="#302138" Margin="40,10,40,0"/> 
        <Button Text="REGISZTRÁCIÓ" Clicked="Register" TextColor="White" BackgroundColor="#302138" Margin="40,0,40,25"/> 
       </StackLayout> 
      </StackLayout> 
     </ScrollView.Content> 
    </ScrollView> 
</Grid> 

기본적으로

Here is the solution

+0

당신은 스크롤로 뭘 원하는거야? 지금은 그리드 내의 모든 항목을 스크롤하려고합니다. 요소의 전체 그룹 만 있기 때문에 스크롤 할 수 없으면 각 요소는 서로 겹칠 수 있습니다. – Neepsnikeep

+0

모든 페이지를 스크롤 할 수 있기를 원합니다. 암호를 입력하려고 할 때 키보드가 그것을 덮었 기 때문에 로그인 버튼을 터치 할 수 없습니다. 모든 콘텐츠를 아래로 스크롤하여 로그인 버튼을 터치 할 수 있습니다. Sry 나의 영어는 좋지 않다. – totesz09

+0

' ...'을' ...'로 바꾸면된다고 생각합니다. 그리드는 뷰포트 크기에 관계없이 필요한만큼 커질 수 있습니다. 그러나 ContentPage는 ** 직접 ** 자식이 ScrollView 일 때 수행 할 작업을 알고 있습니다. 테스트 할 수 없으므로 답변으로 게시하지 않습니다. – Neepsnikeep

답변

0

The Solution is Here

그것은 스크롤하지 않았다. 이 작업을 수행 할 수 있습니다. 이것은 아주 좋은 해결책은 아니지만 작동합니다. 레이블 너비 HeighRequest와 같은 색을 StackLayout에 넣었습니다. 이제 암호를 입력 할 때 페이지를 스크롤 할 수있게되었습니다.

<?xml version="1.0" encoding="utf-8" ?> 
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" 
     xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
     x:Class="Spirocco.LoginPage"> 
<ContentPage.Content> 
    <ScrollView Orientation="Both" x:Name="scrollView"> 
     <ScrollView.Content> 
      <StackLayout BackgroundColor="#302138"> 
       <Image Source="login_logo" Margin="0,0,0,0"></Image> 
       <StackLayout BackgroundColor="White" Margin="20,0,20,30"> 
        <Label Text="ÜDVÖZÖLJÜK!" FontSize="30" FontFamily="Comic Sans MS" Margin="0,15,0,0" TextColor="#302138" HorizontalTextAlignment="Center"></Label> 
        <Entry Text="{Binding Email}" Placeholder="E-mail" Margin="40,0,40,0" Keyboard="Email"/> 
        <Entry Text="{Binding Password}" Placeholder="Jelszó" IsPassword="True" Margin="40,0,40,0"/> 
        <Button Text="BEJELENTKEZÉS" Clicked="Login" TextColor="White" BackgroundColor="#302138" Margin="40,10,40,0"/> 
        <Button Text="REGISZTRÁCIÓ" Clicked="Register" TextColor="White" BackgroundColor="#302138" Margin="40,0,40,25"/> 
       </StackLayout> 
       <Label BackgroundColor="#302138" HeightRequest="160"/> 
      </StackLayout> 
     </ScrollView.Content> 
    </ScrollView> 
</ContentPage.Content> 

+0

아무도 더 좋은 솔루션을 가지고 있습니까? – totesz09

0

이 될 것 그리드의 행의 높이 값은 '*'로 동일하기 때문에 화면의 모든 공간을 차지합니다 : 여기

내 XAML 코드 . 이것이 스크롤 할 수없는 이유입니다.

그런데 실제로 왜 그리드에 중첩되는지는 알 수 없습니다.

이를 시도해보십시오 stacklayout에 충분한 내용이 없기 때문에

<?xml version="1.0" encoding="utf-8" ?> 
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" 
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
    x:Class="Spirocco.LoginPage"> 

<ScrollView Orientation="Both" x:Name="scrollView"> 
    <ScrollView.Content> 
     <StackLayout BackgroundColor="#302138"> 
      <Image Source="login_logo" Margin="0,0,0,0"></Image> 
      <StackLayout BackgroundColor="White" Margin="20,0,20,30"> 
       <Label Text="ÜDVÖZÖLJÜK!" FontSize="30" FontFamily="Comic Sans MS" Margin="0,15,0,0" TextColor="#302138" HorizontalTextAlignment="Center"></Label> 
       <Entry Text="{Binding Email}" Placeholder="E-mail" Margin="40,0,40,0" Keyboard="Email"/> 
       <Entry Text="{Binding Password}" Placeholder="Jelszó" IsPassword="True" Margin="40,0,40,0"/> 
       <Button Text="BEJELENTKEZÉS" Clicked="Login" TextColor="White" BackgroundColor="#302138" Margin="40,10,40,0"/> 
       <Button Text="REGISZTRÁCIÓ" Clicked="Register" TextColor="White" BackgroundColor="#302138" Margin="40,0,40,25"/> 
      </StackLayout> 
     </StackLayout> 
    </ScrollView.Content> 
</ScrollView> 
+0

ScrollView에 부모가 있어야합니다. 또는 Sequent에 No Matching Element Error가 있습니다. – totesz09