文本在运行时诺基亚Lumia 640被压缩

时间:2015-08-23 13:16:09

标签: c# xaml windows-phone-8.1

当我在我的emyulator上时文本看起来很好但是在运行时在lumia 640上查看它时,它看起来像在图片中被压扁是他们无论如何告诉texblox自动增长就像你在带有段落标记的网页中那样? / p>

<PivotItem x:Name="pivot_item1" Header="movie details" Margin="10,-76,28,-20.833" Loaded="pivot_item1_Loaded">
            <StackPanel Height="505">
                <ProgressRing Name="BusyProgressRing" IsActive="False"></ProgressRing>

                <Grid Margin="0,0,0,118" Height="514"  >
                    <TextBlock FontSize="13" x:Name="txtTtile" Text="{Binding name}" HorizontalAlignment="Left" Margin="150,26,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="212" Foreground="White" Height="29" SelectionChanged="txtTtile_SelectionChanged"/>
                    <Image Grid.Row="2" x:Name="moveImage"  Source="{Binding image}" HorizontalAlignment="Left" Height="186" Margin="19,26,0,0" VerticalAlignment="Top" Width="112"/>
                    <TextBlock    FontSize="13" x:Name="txtPlot" Text="{Binding Description}" HorizontalAlignment="Left" Margin="19,217,-28,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="371" Foreground="White" Height="140" SelectionChanged="txtTtile_SelectionChanged" SelectionHighlightColor="White"/>
                    <TextBlock Grid.Row="2" FontSize="13" x:Name="txtTtile_Copy1" HorizontalAlignment="Left" Margin="19,196,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="212" Foreground="White" Height="29" SelectionChanged="txtTtile_SelectionChanged" Text="SYNOPSIS"/>

                    <TextBlock FontSize="13" x:Name="lblrating" HorizontalAlignment="Left" Margin="19,362,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="80" Foreground="White" Height="29" SelectionChanged="txtTtile_SelectionChanged" Text="Rating"/>
                    <TextBlock FontSize="13" x:Name="lblduration" HorizontalAlignment="Left" Margin="19,425,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="104" Foreground="White" Height="29" SelectionChanged="txtTtile_SelectionChanged" Text="Duration"/>
                    <TextBlock FontSize="13" x:Name="txtCategory" HorizontalAlignment="Left" Margin="177,425,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="104" Foreground="White" Height="29" SelectionChanged="txtTtile_SelectionChanged" Text="Category"/>

                    <TextBlock FontSize="13" x:Name="lblcategory" HorizontalAlignment="Left" Margin="248,425,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="104" Foreground="White" Height="29" SelectionChanged="txtTtile_SelectionChanged" Text="{Binding Category}"/>
                    <TextBlock FontSize="13" x:Name="txtduration" HorizontalAlignment="Left" Margin="76,425,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="115" Foreground="White" Height="29" SelectionChanged="txtTtile_SelectionChanged" Text="{Binding Duration}"/>


            </Grid>
            </StackPanel>
</PivotItem>

他们无论如何要确保它将其他控件推下去?

enter image description here

修改 好的,所以我已经改为使用网格系统,但现在我的文字看起来更加平滑我能做些什么才能解决这个问题,它们似乎是一个上面的空间,我似乎无法摆脱我只想要帖子是就在电影细节之下。

<Pivot x:Name="myPivot">
        <PivotItem x:Name="pvtMoveDetails" Header="movie details" Margin="10,-76,28,-20.833" >
            <StackPanel Height="505">
                <ProgressRing Name="BusyProgressRing" IsActive="False"></ProgressRing>

                <Grid Grid.Row="1">
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                        <ColumnDefinition/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <Border  x:Name="brdElement" Margin="0,0,0,0" Grid.Row="0" Grid.Column="0">

                    <Image x:Name="moveImage"  Grid.Row="0" Grid.Column="0"  Source="{Binding image}" HorizontalAlignment="Left" Height="186"    Width="112"/>

                    </Border>
                    <TextBlock FontSize="13" x:Name="txtTtile" HorizontalAlignment="Left" Grid.Row="0" Grid.Column="1"  TextWrapping="Wrap" VerticalAlignment="Top" Width="212" Foreground="White" Height="29" SelectionChanged="txtTtile_SelectionChanged" Text="txttitle"/>

                    <TextBlock Grid.Row="3" Grid.Column="0" Text="Description"></TextBlock>
                    <TextBlock  Grid.Row="3" Grid.Column="0"   FontSize="13" x:Name="txtPlot" Text="{Binding Description}" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Top" Width="371" Foreground="White" Height="247" SelectionChanged="txtTtile_SelectionChanged" SelectionHighlightColor="White"/>



                </Grid>
            </StackPanel>
 </PivotItem>

更改为网格系统后?

enter image description here

注意更多

我做了你所说的更改为网格行系统,但文字仍然没有显示完整我如何给最终用户留下更多文字的印象

enter image description here

1 个答案:

答案 0 :(得分:0)

您正在使用固定位置和边距来放置控件。这只会在与您为其编写的屏幕尺寸相同的屏幕上看起来很好 XAML最适合它flow layout,为此,您需要使用Panels。有几个,GridStackPanelCanvas仅举几例。每个人都以不同的方式呈现给孩子。

例如Grid让您在表格中安排控件,StackPanel将控件一个接一个地放在一个列/行中。

阅读本教程,您应该立即掌握它:http://www.codeproject.com/Articles/140613/WPF-Tutorial-Layout-Panels-Containers-Layout-Trans#heading0005