1

我试图在 Grid 之前将 scollviewer 放入此页面,然后所有文本框都消失了。我应该把滚动查看器放在哪里?它显示警告 1 第 17 行位置 6 上的“网格”开始标记与“电话:PhoneApplicationPage”的结束标记不匹配。第 74 行,位置 3。C:\Users\xxx\Desktop\Excercises_Copy1\Excercises\Running jogging.xaml 74 3 Excercises

并且,未找到元素 Grid 的结束标记

<phone:PhoneApplicationPage 
    x:Class="Excercises.Running_jogging"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="17*" />
            <ColumnDefinition Width="437*" />
            <ColumnDefinition Width="26*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>



        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0">
            <ScrollViewer>
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="36*" />
                        <RowDefinition Height="83*" />
                        <RowDefinition Height="649*" />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="117*" />
                        <ColumnDefinition Width="229*" />
                        <ColumnDefinition Width="110*" />
                    </Grid.ColumnDefinitions>

                    <TextBlock x:Name="TextBlock1" Text="Let's get started" FontWeight="SemiBold" TextAlignment="Center" Height="30" Width="152" Grid.Column="1" />

                    <TextBlock Grid.Row="1" Height="59" HorizontalAlignment="Left" Margin="6,24,0,0" x:Name="TextBlock2" Text="Running is simple and healthy sport and it's also one of the most effective aerobic exercises. Additionally, running does not require large financial outlays. By running you will strengthen the circulatory and immune system and reduce tension caused by stress. Running also helps losing fat." TextWrapping="Wrap" VerticalAlignment="Top" Grid.ColumnSpan="3" Width="444" />
                    <TextBlock Grid.Row="2" Height="30" HorizontalAlignment="Left" x:Name="TextBlock3" Text="Warm-up before running" VerticalAlignment="Top" FontWeight="SemiBold" Grid.Column="1" Grid.ColumnSpan="2" />
                    <TextBlock Grid.Row="2" Height="114" HorizontalAlignment="Left" Margin="6,36,0,0" x:Name="TextBlock4" Text="TRUNK BENDING; Feet at shoulder height, straight legs at knees during the exercise. Bend to the left leg, then to the right and  at the end straighten the body. Repeat 20 times. " TextWrapping="Wrap" VerticalAlignment="Top" Grid.ColumnSpan="3" Width="456" />
                    <TextBlock Grid.Row="2" Height="167" HorizontalAlignment="Left" Margin="6,156,0,0" x:Name="TextBlock5" Text="PLANTAR FASCIA STRETCH; Sit on a chair or stool and cross your right foot over your left thigh. Grasp the toes of your right foot and pull them upward toward your shin. Hold this stretched position for at least 10 seconds. Release and repeat two to three times. Reverse. " VerticalAlignment="Top" Grid.ColumnSpan="3" Width="444" TextWrapping="Wrap" />
                    <TextBlock Grid.Row="2" Height="222" HorizontalAlignment="Left" Margin="6,329,0,0" x:Name="TextBlock6" Text="SEATED HEEL CORD STRETCH; Sit on floor or bench with both feet extended straight out in front of you. Do not lock knees. Wrap a towel around one foot and pull foot toward you. Push foot against the towel for five seconds while you hold the towel still. Relax foot and pull back toward you again. Repeat steps 3 and 4 twice. Reverse." VerticalAlignment="Top" Grid.ColumnSpan="3" Width="444" TextWrapping="Wrap"/>
                    <TextBlock Height="30" HorizontalAlignment="Left" x:Name="TextBlock7" Text="Running test" VerticalAlignment="Top" FontWeight="SemiBold" TextAlignment="Center" Grid.Column="1" Margin="43,557,0,0" Grid.Row="2" />
                    <TextBlock Grid.Row="2" Height="149" HorizontalAlignment="Left" Margin="6,593,0,0" x:Name="TextBlock8" Text="Test is to run continuously with constat pace. The best pace is a jogtrot a little faster than a fast walking. Run as long as you can and measure the time. According to your time choose the right week of the training." VerticalAlignment="Top" Grid.ColumnSpan="3" Width="450" TextWrapping="Wrap"/>
                    <TextBlock HorizontalAlignment="Left" Margin="6,790,0,-1018" x:Name="TextBlock9" Width="456"  TextWrapping="Wrap" Grid.ColumnSpan="3" Grid.Row="2" d:LayoutOverrides="GridBox"><Run Text="- Less then 2 minutes - begin with fast walking" /><Run Text=" "/><LineBreak/><Run Text=" "/><Run Text="- 2-4 minutes - Week 1"/><Run Text=" "/><LineBreak/><Run Text=" "/><Run Text="- 5-6 minutes - Week 3"/><Run Text=" "/><LineBreak/><Run Text=" "/><Run Text="- 7-8 minutes - Week 4"/><Run Text=" "/><LineBreak/><Run Text=" "/><Run Text="- 9-10 minutes - Week 6"/><Run Text=" "/><LineBreak/><Run Text=" "/><Run Text="- 11-12 minutes - Week 7"/><Run Text=" "/><LineBreak/><Run Text=" "/><Run Text="- 13-14 minutes - Week 8"/><Run Text=" "/><LineBreak/><Run Text=" "/><Run Text="- More then 15 miuntes - Week 10 "/></TextBlock>
                    <Grid.Background>
                        <ImageBrush ImageSource="/Excercises;component/Images/tlo.png" />
                    </Grid.Background>
                </Grid>
            </ScrollViewer>
        </Grid>

        <!--Sample code showing usage of ApplicationBar-->
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->
</phone:PhoneApplicationPage>
4

1 回答 1

1

您的布局非常复杂,但您可以将滚动查看器放在 ContentPanel 中并在其中创建一个新网格

<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0">
<ScrollViewer>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="36*" />
            <RowDefinition Height="83*" />
            <RowDefinition Height="649*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="117*" />
            <ColumnDefinition Width="229*" />
            <ColumnDefinition Width="110*" />
        </Grid.ColumnDefinitions>

        <TextBlock x:Name="TextBlock1" Text="Let's get started" FontWeight="SemiBold" TextAlignment="Center" Height="30" Width="152" Grid.Column="1" />

        <TextBlock Grid.Row="1" Height="59" HorizontalAlignment="Left" Margin="6,24,0,0" x:Name="TextBlock2" Text="Running is simple and healthy sport and it's also one of the most effective aerobic exercises. Additionally, running does not require large financial outlays. By running you will strengthen the circulatory and immune system and reduce tension caused by stress. Running also helps losing fat." TextWrapping="Wrap" VerticalAlignment="Top" Grid.ColumnSpan="3" Width="444" />
        <TextBlock Grid.Row="2" Height="30" HorizontalAlignment="Left" x:Name="TextBlock3" Text="Warm-up before running" VerticalAlignment="Top" FontWeight="SemiBold" Grid.Column="1" Grid.ColumnSpan="2" />
        <TextBlock Grid.Row="2" Height="114" HorizontalAlignment="Left" Margin="6,36,0,0" x:Name="TextBlock4" Text="TRUNK BENDING; Feet at shoulder height, straight legs at knees during the exercise. Bend to the left leg, then to the right and  at the end straighten the body. Repeat 20 times. " TextWrapping="Wrap" VerticalAlignment="Top" Grid.ColumnSpan="3" Width="456" />
        <TextBlock Grid.Row="2" Height="167" HorizontalAlignment="Left" Margin="6,156,0,0" x:Name="TextBlock5" Text="PLANTAR FASCIA STRETCH; Sit on a chair or stool and cross your right foot over your left thigh. Grasp the toes of your right foot and pull them upward toward your shin. Hold this stretched position for at least 10 seconds. Release and repeat two to three times. Reverse. " VerticalAlignment="Top" Grid.ColumnSpan="3" Width="444" TextWrapping="Wrap" />
        <TextBlock Grid.Row="2" Height="222" HorizontalAlignment="Left" Margin="6,329,0,0" x:Name="TextBlock6" Text="SEATED HEEL CORD STRETCH; Sit on floor or bench with both feet extended straight out in front of you. Do not lock knees. Wrap a towel around one foot and pull foot toward you. Push foot against the towel for five seconds while you hold the towel still. Relax foot and pull back toward you again. Repeat steps 3 and 4 twice. Reverse." VerticalAlignment="Top" Grid.ColumnSpan="3" Width="444" TextWrapping="Wrap"/>
        <TextBlock Height="30" HorizontalAlignment="Left" x:Name="TextBlock7" Text="Running test" VerticalAlignment="Top" FontWeight="SemiBold" TextAlignment="Center" Grid.Column="1" Margin="43,557,0,0" Grid.Row="2" />
        <TextBlock Grid.Row="2" Height="149" HorizontalAlignment="Left" Margin="6,593,0,0" x:Name="TextBlock8" Text="Test is to run continuously with constat pace. The best pace is a jogtrot a little faster than a fast walking. Run as long as you can and measure the time. According to your time choose the right week of the training." VerticalAlignment="Top" Grid.ColumnSpan="3" Width="450" TextWrapping="Wrap"/>
        <TextBlock HorizontalAlignment="Left" Margin="6,790,0,-1018" x:Name="TextBlock9" Width="456"  TextWrapping="Wrap" Grid.ColumnSpan="3" Grid.Row="2" d:LayoutOverrides="GridBox"><Run Text="- Less then 2 minutes - begin with fast walking" /><Run Text=" "/><LineBreak/><Run Text=" "/><Run Text="- 2-4 minutes - Week 1"/><Run Text=" "/><LineBreak/><Run Text=" "/><Run Text="- 5-6 minutes - Week 3"/><Run Text=" "/><LineBreak/><Run Text=" "/><Run Text="- 7-8 minutes - Week 4"/><Run Text=" "/><LineBreak/><Run Text=" "/><Run Text="- 9-10 minutes - Week 6"/><Run Text=" "/><LineBreak/><Run Text=" "/><Run Text="- 11-12 minutes - Week 7"/><Run Text=" "/><LineBreak/><Run Text=" "/><Run Text="- 13-14 minutes - Week 8"/><Run Text=" "/><LineBreak/><Run Text=" "/><Run Text="- More then 15 miuntes - Week 10 "/></TextBlock>
        <Grid.Background>
            <ImageBrush ImageSource="/Excercises;component/Images/tlo.png" />
        </Grid.Background>
    </Grid>
</ScrollViewer>
</Grid>
于 2012-07-11T23:28:06.417 回答