2012-05-28 2 views
1

Windows Phone 7 개발에서 새로 생겼습니다. 스크롤 뷰어를 사용하는 앱을 시작했습니다. 에뮬레이터에서 페이지가 스크롤되지 Windows Phone 7의 스크롤 뷰어가 작동하지 않습니다.

 <!--TitlePanel contains the name of the application and page title--> 


     <!--ContentPanel - place additional content here--> 
     <ScrollViewer>     
      <StackPanel Margin="0,150,0,0"> 
       <toolkit:PhoneTextBox Hint="UserName" Name="txtUsername" Width="auto" HintStyle="{StaticResource HintCustomStyle}" LengthIndicatorVisible="True" DisplayedMaxLength="6" ></toolkit:PhoneTextBox> 
       <toolkit:PhoneTextBox Name="txtFname" Hint="First Name" Width="auto" HintStyle="{StaticResource HintCustomStyle}" LengthIndicatorVisible="True" DisplayedMaxLength="20"></toolkit:PhoneTextBox> 
       <toolkit:PhoneTextBox Name="txtLastName" Hint="Last Name" Width="auto" HintStyle="{StaticResource HintCustomStyle}" LengthIndicatorVisible="True" DisplayedMaxLength="20"></toolkit:PhoneTextBox> 
       <toolkit:PhoneTextBox Hint="Password" Name="txtPassword" Width="auto" HintStyle="{StaticResource HintCustomStyle}" LengthIndicatorVisible="True" DisplayedMaxLength="6" ></toolkit:PhoneTextBox> 
       <toolkit:PhoneTextBox Hint="Cofirm Password" Name="txtConfirmPassword" Width="auto" HintStyle="{StaticResource HintCustomStyle}" LengthIndicatorVisible="True" DisplayedMaxLength="6" LostFocus="txtConfirmPassword_LostFocus"></toolkit:PhoneTextBox> 
       <toolkit:PhoneTextBox Hint="Emplyee ID" Name="txtEmployeeID" Width="auto" HintStyle="{StaticResource HintCustomStyle}" LengthIndicatorVisible="True" DisplayedMaxLength="6"></toolkit:PhoneTextBox> 
       <Button Content="Create QR Code and Sign Up" Name="btnCreateQR" Width="auto" Click="btnCreateQR_Click"> 
        <Button.Background> 
         <ImageBrush ImageSource="\assests\backgroungimages\btnImage.jpg" Stretch="UniformToFill"></ImageBrush> 
        </Button.Background> 
       </Button> 
      </StackPanel> 
     </ScrollViewer> 
    </Grid> 

</Grid> 

: 여기 내 코드입니다. 마우스 버튼을 누른 채로 스크롤하면 스크롤되지만 뒤로 마우스 버튼을 놓은 후 원래 상태로 돌아갑니다. 제발 도와주세요 .... 고맙습니다!

답변

3

scrollviewer 내부의 스택 패널 높이는 언급되지 않았습니다. 스크롤 뷰어 내부의 컨트롤이 높이보다 큰 경우에만 스크롤이 지원됩니다. 따라서 스크롤 뷰어의 높이와 스택 패널의 높이를 1500으로 설정하는 것이 좋습니다.

<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0" Background="Black"> 
     <ScrollViewer Height="1500"> 
      <StackPanel Height="1500" Margin="0,150,0,0"> 
       <TextBox Name="txtUsername" Width="auto" /> 
       <TextBox Name="txtFname" Width="auto"/> 
       <TextBox Name="txtLastName" Width="auto" /> 
       <TextBox Name="txtPassword" Width="auto" /> 
       <TextBox Name="txtConfirmPassword" Width="auto" /> 
       <TextBox Name="txtEmployeeID" Width="auto" /> 

      </StackPanel> 
     </ScrollViewer> 
    </Grid> 

는 당신을 위해 노력하고 이제 잘

+0

작동이 시도? –

+2

위대한 !! 작동 중! 감사합니다. !!! – Mushfiq