• 十四、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中获得整个屏幕的整个点击事件,如图所示

  • 相关阅读:
    MVC 和 MVVM
    Objective-C对象模型及应用
    面试总汇二
    iOS中常用的四种数据持久化方法简介
    iOS应用程序生命周期
    SDWebImage的总结
    面试知识点总汇
    block 的演练和使用
    Java 类 生成数据库表
    sql中写标量函数生成大写拼音首字母
  • 原文地址:https://www.cnblogs.com/suinuaner/p/fourteen.html
Copyright © 2020-2023  润新知