【问题标题】:textbox scrolling not fit in windows phone文本框滚动不适合 windows phone
【发布时间】:2013-10-17 11:05:04
【问题描述】:
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
     <ScrollViewer  Height="400" HorizontalAlignment="Left" Margin="18,0,0,0" Name="scrollViewer1" VerticalAlignment="Top" Width="400" Grid.Row="1" VerticalScrollBarVisibility="Auto">
         <StackPanel Height="Auto" x:Name="TitlePanelOne" Background="AliceBlue" Grid.Row="0" Margin="12,17,0,28">
              <toolkit:PhoneTextBox Background="Aquamarine" Hint="tap to enter the title" BorderThickness="2"></toolkit:PhoneTextBox>
              <toolkit:PhoneTextBox Foreground="Black" AcceptsReturn="True" TextWrapping="Wrap" Hint="Tap To entr the Note" BorderThickness="2" VerticalAlignment="Top" Height="Auto" HorizontalAlignment="Left" Name="textBox1" Width="460"></toolkit:PhoneTextBox>
         </StackPanel>
     </ScrollViewer>
</Grid>

代码工作正常,但问题是如果我在文本框中输入单词,它会获得滚动视图。

如果我在文本框中输入更多行,则输入行不会向用户显示如何避免这种情况,有什么猜测吗?

【问题讨论】:

    标签: c# xaml windows-phone-7 textbox scrollview


    【解决方案1】:

    只需复制此块而不是您的块。

    <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
          <StackPanel Height="420" x:Name="TitlePanelOne" Background="AliceBlue" Grid.Row="0" Margin="12,17,0,28" Width="400">
             <toolkit:PhoneTextBox Background="Aquamarine" Hint="tap to enter the title" BorderThickness="2"></toolkit:PhoneTextBox>
             <ScrollViewer  Height="320" HorizontalAlignment="Left" Margin="0,0,0,0" Name="scrollViewer1" VerticalAlignment="Top" Width="400" Grid.Row="1" VerticalScrollBarVisibility="Auto">
                  <toolkit:PhoneTextBox Foreground="Black" AcceptsReturn="True" Margin="10,0,0,0" TextWrapping="Wrap" Hint="Tap To entr the Note" BorderThickness="2" VerticalAlignment="Top" Height="250" HorizontalAlignment="Left" Name="textBox1" Width="380"></toolkit:PhoneTextBox>
             </ScrollViewer>
         </StackPanel>
    </Grid>
    

    请设置文本框的高度,以便在输入行上轻松显示用户的文本。

    它根据您的查询工作。谢谢。

    我希望你能得到解决方案。

    【讨论】:

      猜你喜欢
      • 2014-06-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多