zoukankan      html  css  js  c++  java
  • 十四、AppBar

    当向上手势或鼠标右键的时候会显示AppBar,AppBar分为顶部TopAppBar和底部BottomAppBar两种,建议把主要操作放在底部,顶部有特殊意义时再放。

    顶部TopAppBar和底部BottomAppBar是Page的两个属性值,两者的样式一般采用StandardStyles.xaml中预置的 ***AppBarButtonStyle样式,用到那个就反注释哪个。

    简单

    在根标签之后加上


        <Page.TopAppBar>
            <AppBar>
                <AppBar.Content> //在Content下可以写多个控件
                    <Button Content="hello"></Button>
                </AppBar.Content>
            </AppBar>
        </Page.TopAppBar>

    或者


        <Page.TopAppBar>
            <AppBar>
                //在AppBar标签下可以写多个控件
                    <Button Content="hello"></Button>
        </AppBar>
        </Page.TopAppBar>

    复杂

    第一步:将StandardStyles.xaml中需要的样式取消注释。注意,取消注释之后,最好放在剩余注释的前面,而且紧跟剩余注释。

    第二步:在.xaml的文件中使用即可。


        <Page.TopAppBar>
            <AppBar>
                <StackPanel Orientation="Horizontal">
                    <Button Style="{StaticResource PlayAppBarButtonStyle }" AutomationProperties.Name="播放"></Button>
                    <Button Style="{StaticResource EditAppBarButtonStyle }" AutomationProperties.Name="edit"></Button>
                </StackPanel>
            </AppBar>
        </Page.TopAppBar>

    生成的图为

    说明:(1)如果要求一打开页面AppBar是显示存在的,则应该设置AppBar的一个属性,即 IsOpen="true"。

             (2)如果要求页面中AppBar一直是存在的,则应该设置AppBar的一个属性,即IsSticky=“true”。

             (3)在gridview中获得整个屏幕的整个点击事件,如图所示

  • 相关阅读:
    类BufferedImage
    Fileltem
    文件上传api——MultipartFile
    热插播 devtools
    生成banner
    maven 配置
    配置java环境变量
    u盘如何恢复存储量
    四则运算
    PM
  • 原文地址:https://www.cnblogs.com/suinuaner/p/fourteen.html
Copyright © 2011-2022 走看看