在 XAML WP8 中使用数据透视时遇到问题。好像SIGN UP
中的第二个 Pivot 似乎不想显示我给出的任何工具,比如按钮等。
我最近修改了网格,所以我认为你也应该检查一下。
<phone:PhoneApplicationPage
x:Class="Help_.MainPage"
xmlns:Primitives="clr-namespace:Microsoft.Phone.Controls.Primitives;assembly=Microsoft.Phone"
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"
mc:Ignorable="d"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="True">
<phone:PhoneApplicationPage.Resources>
<shell:ApplicationBar x:Key="AppbarLogin" IsVisible="True" IsMenuEnabled="True">
<shell:ApplicationBarIconButton IconUri="/Assets/AppBar/check.png" Text="sign in" Click="ApplicationBarIconButton_Click"/>
<shell:ApplicationBar.MenuItems>
<shell:ApplicationBarMenuItem Text="about" Click="ApplicationBarMenuItem_Click"/>
</shell:ApplicationBar.MenuItems>
</shell:ApplicationBar>
<shell:ApplicationBar x:Key="AppbarSignup" IsVisible="True" IsMenuEnabled="True">
<shell:ApplicationBarIconButton IconUri="/Assets/AppBar/check.png" Text="sign up" Click="ApplicationBarIconButton_Click_2"/>
<shell:ApplicationBar.MenuItems>
<shell:ApplicationBarMenuItem Text="about" Click="ApplicationBarMenuItem_Click"/>
</shell:ApplicationBar.MenuItems>
</shell:ApplicationBar>
<Style x:Key="GambarHeader" TargetType="phone:Pivot">
<Setter Property="Margin" Value="0"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="phone:Pivot">
<Grid HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" MinHeight="100"/>
<RowDefinition Height="Auto" MinHeight="46"/>
<RowDefinition Height="229*"/>
<RowDefinition Height="64*"/>
</Grid.RowDefinitions>
<Grid Background="{TemplateBinding Background}" Grid.RowSpan="3"/>
<Grid Background="Transparent">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Image
Source="/Assets/Gambar/help_text_comp.png"
HorizontalAlignment="Left"
Margin="20,12,0,0"
Grid.ColumnSpan="2"
Width="120" />
</Grid>
<Primitives:PivotHeadersControl x:Name="HeadersListElement" Grid.Row="1"/>
<ItemsPresenter x:Name="PivotItemPresenter" Margin="{TemplateBinding Padding}" Grid.Row="2"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<local:LocalizedStrings xmlns:local="clr-namespace:Help_" x:Key="LocalizedStrings"/>
</phone:PhoneApplicationPage.Resources>
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="#14b29b">
<!--Pivot Control-->
<phone:Pivot Title="" Style="{StaticResource GambarHeader}" HeaderTemplate="{StaticResource SmallSizeHeader}" SelectionChanged="SelectionPivot_Changed">
<!--Pivot item one-->
<phone:PivotItem Header="SIGN IN" Margin="12,28,12,-61" Height="513" VerticalAlignment="Top">
<Grid Height="513" VerticalAlignment="Top">
<TextBox
HorizontalAlignment="Left" Margin="0,10,0,0" TextWrapping="Wrap" Text="Email" Width="446" Foreground="Gray" GotFocus="TextBox_GotFocus_2" LostFocus="TextBox_LostFocus_2" Height="75" VerticalAlignment="Top"/>
<Grid Margin="0,85,10,236">
<TextBox x:Name="PasswordWatermark" TextWrapping="Wrap" Text="Password" Foreground="{StaticResource PhoneTextBoxReadOnlyBrush}" IsHitTestVisible="False" Height="75" VerticalAlignment="Top"/>
<PasswordBox x:Name="Password" LostFocus="PasswordLostFocus" Opacity="0" Password="{Binding Password, Mode=TwoWay}" GotFocus="PasswordGotFocus" HorizontalAlignment="Left" Height="75" VerticalAlignment="Top" Width="446"/>
</Grid>
<Button x:Name="SigninFacebook" Content="Sign in with Facebook" HorizontalAlignment="Left" Margin="10,317,0,0" VerticalAlignment="Top" Width="436" Click="SigninFacebook_Click"/>
</Grid>
</phone:PivotItem>
<!--Pivot item two-->
<phone:PivotItem Header="SIGN UP" Margin="12,28,12,-61" Height="457" VerticalAlignment="Top">
<Button Content="11" />
</phone:PivotItem>
</phone:Pivot>
</Grid>
</phone:PhoneApplicationPage>