简体   繁体   English

无法更改与Windows Phone 8中的透视图项不同的透视图的前景色

[英]Unable to change the foreground color of Pivot different from Pivot Item in windows phone 8

Purpose 目的

I want to change my phone pivot and pivot item to be different foreground color from each other; 我想将手机支点和支点项更改为彼此不同的前景色; I want pivot to be white and pivot item to be pink foreground color. 我想将透视表设置为白色,将透视表项设置为粉红色前景色。

Problem 问题

When I tried to change the pivot foreground color to white, the all the pivot items inside that pivot will take the same foreground color as their parent pivot no matter what foreground color I assigned to pivot items. 当我尝试将透视图前景色更改为白色时,无论我为透视图项目分配了哪种前景色,该透视图内的所有透视图项目都将采用与其父透视图相同的前景色。

My code 我的密码

Here are my design in xmal file: 这是我在xmal文件中的设计:

<phone:Pivot Title="SKIN TEST" Foreground="#000000" Margin="-10,-30,0,0">
            <phone:PivotItem Header="product" Margin="10,37,14,-9">

                <Grid>
                    <!-- Title product detail -->
                    <ScrollViewer Height="Auto" Margin="32,-71,-22,91" Foreground="#000000">
                        <StackPanel>
                            <TextBlock FontSize="26" x:Name="txtbPro_Name" HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="{Binding ItemDryName}" VerticalAlignment="Top" RenderTransformOrigin="0.254,-0.205" Height="auto" Width="414" MaxWidth="440" MaxHeight="240"/>
                            <!-- Image product detail -->
                            <Image x:Name="img_Product" HorizontalAlignment="Left" Height="220" Margin="10,10,0,0" VerticalAlignment="Top" Width="220" Source="{Binding ItemDryImage}"/>
                            <!-- Ingredient product detail -->
                            <TextBlock HorizontalAlignment="Left" Margin="10,30,0,0" TextWrapping="Wrap" Text="Ingredient"  Foreground="#000000" VerticalAlignment="Top" RenderTransformOrigin="-1.887,-1.756" Height="36" Width="412" FontSize="24"/>
                            <TextBlock x:Name="txtb_ingridient" HorizontalAlignment="Left" Margin="10,15,0,30" TextWrapping="Wrap"  Foreground="#000000" VerticalAlignment="Top" Height="auto" Width="412" FontSize="24"/>

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

            </phone:PivotItem>

            <phone:PivotItem Header="description">
                <Grid>
                    <!-- Description of product detail -->
                    <ScrollViewer Height="Auto" Margin="10,0,0,-315" Foreground="#000000">
                        <StackPanel>
                            <TextBlock x:Name="txtb_description1" Text="" TextWrapping="Wrap" Width="auto"  FontSize="24"/>
                            <Line Width="100" Height="10"/>
                            <TextBlock x:Name="txtb_description2" Text="" TextWrapping="Wrap" Width="auto" FontSize="24"/>
                        </StackPanel>
                    </ScrollViewer>
                </Grid>
            </phone:PivotItem>

            <phone:PivotItem Header="how to use">
                <Grid>
                    <!-- How to use of product detail-->
                    <TextBlock x:Name="txtb_howToUse" HorizontalAlignment="Left" Margin="10,0,0,0" TextWrapping="Wrap" Foreground="#000000" FontSize="24" 
                               Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit.  " VerticalAlignment="Top" Height="593" Width="auto"/>
                </Grid>
            </phone:PivotItem>
        </phone:Pivot>

How can I make it different? 我该如何使其与众不同? Do I need to apply any static resource and style on each pivot?? 我是否需要在每个枢轴上应用任何静态资源和样式?

I tried your code and I can't see what is what you want to do exactly or your problem. 我尝试了您的代码,但看不到您要确切执行的操作或遇到的问题。 phone:Pivot foreground is for the Main title of the pivot if I set it to pink, only that title changes. phone:透视图前景用于透视图的主标题(如果我将其设置为粉红色),仅该标题会更改。 The pivotItem foreground gives color to the content inside it (not the header!), but the you should remove the foregound color in the scrollviewer to si the changes. ivotItem前景为其中的内容(而不是标题!)赋予颜色,但是您应该在scrollviewer中删除前景色以进行更改。 Is your problem with the header? 您的标题有问题吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM