标签: appbar

ListView和AppBar合作.最简单的多选方案

与AppBar一起实现列表视图多选方案的SIMPLEST方法是什么?因此,当选择多个项目时(例如,通过鼠标右键单击),它的行为与Windows 8开始屏幕完全相同.

我想显示应用栏以及第一个选定的列表视图项,我想用第二个,第三个等保持打开,我希望通过任何应用栏按钮操作(执行上下文操作)或通过其他系统范围的应用栏关闭操作(例如,右键单击其他位置,这将意味着上下文操作被取消).

我目前的实施太复杂了.我相信我一定错过了一些东西 - 这种基本和常见的场景必须能够以标准化的方式实施.

脚手架代码准备如下.如果只有此代码使用了应用栏,则在右键单击第二个列表视图项之前隐藏,再需要右键单击列表视图(不可接受).如果与IsSticky结合使用,则根本无法选择第二个列表视图项.

<Page
    x:Class="ListViewAndAppBar.ExamplePage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:ListViewAndAppBar"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    DataContext="{Binding ExamplePageViewModel, Source={StaticResource Locator}}">

    <Grid Background="Gray">
        <ListView
            x:Name="ListView"
            ItemsSource="{Binding Persons}"
            SelectionMode="Multiple"
            SelectionChanged="ListView_SelectionChanged">
        </ListView>
    </Grid>

    <Page.BottomAppBar>
        <AppBar x:Name="BottomAppBar" Padding="10,0,10,0">
            <Button x:Name="BottomAppBarBack" Tag="Back" Style="{StaticResource BackAppBarButtonStyle}" HorizontalAlignment="Left" />
        </AppBar>
    </Page.BottomAppBar>
</Page>

private void ListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
    this.BottomAppBar.IsOpen = true;
    //this.BottomAppBar.IsSticky = true;
}
Run Code Online (Sandbox Code Playgroud)

c# xaml appbar windows-8 windows-store-apps

2
推荐指数
1
解决办法
4047
查看次数

Win8 JS App:如何防止后向导航?无法设置WinJS.Navigation.canGoBack

对于Windows 8的开发来说相当新,我正在开发一款具有相当扁平模型的应用程序.我看了看,但似乎无法找到如何设置WinJS页面以防止向后导航的明确答案.我已经尝试深入研究API,但它没有就此问题发表任何意见.

我试图使用的代码是

WinJS.Navigation.canGoBack = false;
Run Code Online (Sandbox Code Playgroud)

没有运气,它一直在抱怨只读属性,但是,没有setter方法可以改变它.

提前谢谢,〜肖恩

navigation appbar windows-8 winjs

2
推荐指数
1
解决办法
2030
查看次数

具有Appbar的Material-UI Drawer不使用组件语法

我已经从这个创建了一个新线程以避免混淆,因为有人告诉我Leftnav现在Drawer在Material-UI组件中.

我还有问题,第一个是ES7?这里显示的箭头函数的语法.我已经改为使用扁平链接的以下代码,以便尝试了解发生了什么:

import React, { Component } from 'react'
import { Drawer, AppBar, MenuItem} from 'material-ui'
import baseTheme from 'material-ui/styles/baseThemes/lightBaseTheme'
import getMuiTheme from 'material-ui/styles/getMuiTheme'
import { Route, Router } from 'react-router'



export default class Header extends Component  {

  constructor(props){
    super(props);
    this.state = {open:false};
  }

  getChildContext() {
    return {muiTheme: getMuiTheme(baseTheme)};
  }


  handleToggle() {
    this.setState({open: !this.state.open});
    console.log("open")
   }
  handleClose() { this.setState({open: false}); }
        render() {


            return (
                <div>
                <Drawer
                  docked={false}
                  open={false}>
                  <MenuItem onTouchTap={this.handleClose}>Menu Item …
Run Code Online (Sandbox Code Playgroud)

appbar drawer material-ui

2
推荐指数
1
解决办法
7076
查看次数

Flutter:检测到滚动时隐藏和显示应用栏

我在应用栏动画方面遇到问题,我SilverAppBar在我的应用中使用, 。所以,问题是当我在我的列表中间并向上滚动时,应用栏不会出现,但它会在滚动到达项目列表顶部时出现。我已经测试了snap参数并给出了它true,但不是我期望的结果。我有为此创建自定义动画的想法,但我在 Flutter 方面经验不足,而且如果有一种方法可以添加参数或其他适合我的情况的小部件,那就太好了。

我正在使用的演示的实际代码:

  Widget _search() => Container(
        color: Colors.grey[400],
        child: SafeArea(
            child: Container(
          child: Padding(
            padding: const EdgeInsets.all(8.0),
            child: TextField(
              enabled: false,
              style: TextStyle(fontSize: 16, color: Colors.white),
              decoration: InputDecoration(
                prefix: SizedBox(width: 12),
                hintText: "Search",
                contentPadding:
                    EdgeInsets.symmetric(horizontal: 32.0, vertical: 14.0),
                border: InputBorder.none,
              ),
            ),
          ),
        )),
      );

  Container _buildBody() {
    return Container(
        child: new GridView.count(
      crossAxisCount: 2,
      children: List.generate(100, (index) {
        return Center(
          child: Text(
            'Item $index',
            style: Theme.of(context).textTheme.headline,
          ),
        );
      }),
    )); …
Run Code Online (Sandbox Code Playgroud)

animation scroll appbar flutter

2
推荐指数
1
解决办法
1万
查看次数

AppBar 标题带有图像抖动

我有附加的 AppBar,我想在标题旁边添加图像,而不是操作图标,仅添加图像,我该如何处理这个问题?

appBar: AppBar(
            title: Text('Title'),
            actions: <Widget>[
              new IconButton(
                icon: new Icon(Icons.refresh),
                onPressed: () {
                  setState(
                    () {
                      widget.athkarCategory.reset();
                    },
                  );
                },
              ),
            ],
          ),
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

appbar dart flutter

2
推荐指数
1
解决办法
6480
查看次数

删除 Vuetify v-app-bar 上的默认填充

Vuetifyv-app-bar有默认的CSS classesesv-toolbar__contentv-toolbar__extension,增加了16px对x轴和衬垫4px在y轴上,我想摆脱的。

我已经尝试在我的 css 中覆盖这些类,如下所示

.v-toolbar__content {
  padding: 0px !important;
}
Run Code Online (Sandbox Code Playgroud)

但它不起作用。有人知道一些有助于摆脱填充的技巧v-app-bar吗?

css appbar vue.js vuetify.js

2
推荐指数
1
解决办法
3384
查看次数

减少 flutter 中应用栏按钮的填充

如何减少按钮之间的间距?

您可以看到应用程序栏上的四个按钮占用了很多空间,我尝试过行。但没有工作

在此输入图像描述 下面是我的代码——

 AppBar(
  backgroundColor: Colors.deepOrange,
  iconTheme: new IconThemeData(color: Colors.white),
  title: Text(
    titleString,
    style: TextStyle(color: Colors.white),
  ),

  actions: <Widget>[

    IconButton(

      icon: Icon(
        Icons.search,
        color: Colors.white,
      ),
      //iconSize: 20,
      onPressed: null,
    ),
    IconButton(
      icon: Icon(
        Icons.notifications_none,
        color: Colors.white,
      ),
     // iconSize: 20,

      onPressed: null,
    ),
    //Add more icon here

  ],
);
Run Code Online (Sandbox Code Playgroud)

appbar dart flutter

2
推荐指数
1
解决办法
8911
查看次数

如何从 Material UI for React 在我的应用程序中添加带有返回顶部按钮的 AppBar?

在 Material UI 的文档中,我找到了这段代码:

import React from 'react';
import PropTypes from 'prop-types';
import AppBar from '@material-ui/core/AppBar';
import Toolbar from '@material-ui/core/Toolbar';
import Typography from '@material-ui/core/Typography';
import { makeStyles } from '@material-ui/styles';
import CssBaseline from '@material-ui/core/CssBaseline';
import useScrollTrigger from '@material-ui/core/useScrollTrigger';
import Box from '@material-ui/core/Box';
import Container from '@material-ui/core/Container';
import Fab from '@material-ui/core/Fab';
import KeyboardArrowUpIcon from '@material-ui/icons/KeyboardArrowUp';
import Zoom from '@material-ui/core/Zoom';

const useStyles = makeStyles((theme) => ({
    root: {
        position: 'fixed',
        bottom: theme.spacing(2),
        right: theme.spacing(2),
    },
}));

function ScrollTop(children) {
    const classes = …
Run Code Online (Sandbox Code Playgroud)

javascript appbar jsx reactjs material-ui

2
推荐指数
1
解决办法
3939
查看次数

Flutter AppBar 前导文本

我想在我的 AppBar 中领先: Icon(Icons.settings) 到 ==> Text('Settings'),

当我刚刚做的时候 leading: Text('Cancel', style: TextStyle(fontSize: 20)),

在此输入图像描述


并且需要像这样下来

图像

基本上我想使前导成为文本而不是图标,这可能吗?

appbar ios flutter flutter-layout

2
推荐指数
1
解决办法
4937
查看次数

无法在标题文本小部件上应用 AppBar titleTextStyle

我无法使用 AppBar titleTextStyle 更改我的 AppBar 标题文本颜色。我知道我可以通过某些方式设置 AppBar 标题样式,例如在 textWidget 中使用样式或在 AppBar 中设置 textTheme,但我只想知道为什么不能通过设置 titleTextStyle 来更改它。

代码如下。尽管设置了 titleTextStyle 和 foregroundColor,AppBar 标题仍然是白色的。

class MyStatelessWidget extends StatelessWidget {
  const MyStatelessWidget({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        foregroundColor: Colors.black,
        titleTextStyle: TextStyle(color: Colors.black),
        title: const Text('AppBar Color'),),
      body: const Center(
        child: Text('sample'),
      ),
    );
  }
}
Run Code Online (Sandbox Code Playgroud)

appbar dart flutter

2
推荐指数
2
解决办法
1121
查看次数