我最近尝试在没有 AppBar 或至少完全不可见的情况下为我的菜单滑块保留一个汉堡图标。第一次尝试是使用 SafeArea 但它清空了 Scaffold。然后我尝试将不透明度设置为 0.0,如下面的代码所示。但它给出了与 SafeArea 相同的结果,在 Scaffold 上没有任何内容。请问有人可以帮忙吗?
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
State<StatefulWidget> createState() => MyAppState();
}
class MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return new MaterialApp(
theme: ThemeData(
// Define the default Brightness and Colors
brightness: Brightness.dark,
primaryColor: Colors.lightBlue[800],
accentColor: Colors.cyan[600],
),
home: Scaffold(
Opacity(
opacity: 0.0,
appBar: AppBar(),
),
drawer: new Drawer(
child: new ListView(),
),
body: new Center(
child: new Column(
children: <Widget>[], …
Run Code Online (Sandbox Code Playgroud) 我一直遇到错误,直到重新设置Metro Bundle并执行更新为止,从所需的模块“ 699”到“ 700”的错误不断出现,现在是这样。我相信我具有Drawer导航器和ionicicons所需的所有依赖关系,但错误仍然持续存在。我有用不同文件编写的代码,但是下面是用App.js编写的代码。随意询问其他问题,以解决当前的问题。
import React from 'react';
import {
View,
Text,
StyleSheet
} from "react-native" ;
import DrawerNavigator from './Menu/DrawerNavigator';
import SettingScreen from './Menu/SettingScreen'
export default class App extends React.Component {
render(){
return (
<View style ={style.container}>
<SettingScreen/>
</View>
);
}
}
style = StyleSheet.create ({
container: {
flex: 1,
justifyContent: 'center',
},
});
Run Code Online (Sandbox Code Playgroud) 嘿,我最近将“ react-native-tab-view”:“ ^ 2.2.0”降级为“ ^ 1.3.2”,在关闭模拟器和终端之前,它一直运行良好。重新运行它后,无论该代码停留在什么地方,都会显示以下错误。谁能帮忙
我尝试将最重要的版本替换为先前的版本,并将代码结构改回以前的版本,以确保以防万一。但是没有结果
Failed to load bundle(http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false) with error:(Unable to resolve module `_wrapObjectFreezeAndFriends` from `/Users/camillebasbous/Project/node_modules/react-native/Libraries/Core/polyfillES6Collections.js`: Module `_wrapObjectFreezeAndFriends` does not exist in the Haste module map
This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
1. Clear watchman watches: `watchman watch-del-all`.
2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`.
4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`. (null))
__38-[RCTCxxBridge loadSource:onProgress:]_block_invoke.228 …
Run Code Online (Sandbox Code Playgroud) 我正在使用 Material UI 选项卡和 React-Router,两者在视觉上都运行良好,但我在使用开发人员工具时意识到每次单击选项卡或在手机尺寸的情况下单击菜单按钮时都会出现错误。错误说:
index.js:1375 Warning: Material-UI: the value provided
/to the Tabs component is invalid. None of the Tabs children have this value. You can provide one of the following values: 0, 1, 2, 3, 4, 5.
我尝试用状态和活动索引结构替换路由器,但错误仍然存在。如何确保在单击选项卡或菜单按钮时不会发生错误?以及如何确保它通过相关路径将我们顺利引导到相关页面?谢谢
PS:他们指向的屏幕都是文本,目前,没有什么特别的,如果需要显示代码,我可以编辑帖子,尽管我对此表示怀疑。再次感谢
import React from 'react';
import AppBar from '@material-ui/core/AppBar';
import CssBaseline from '@material-ui/core/CssBaseline';
import Drawer from '@material-ui/core/Drawer';
import Hidden from '@material-ui/core/Hidden';
import IconButton from '@material-ui/core/IconButton';
import MenuIcon from '@material-ui/icons/Menu';
import Toolbar from '@material-ui/core/Toolbar';
import Typography from '@material-ui/core/Typography';
import { …
Run Code Online (Sandbox Code Playgroud) 我已经有一段时间了,这是怎么回事。我在mobx Storage中有一个数组,希望在我的React本机组件的Flatlist中的可折叠视图中显示。这里的问题是,当我单击它时,它确实会更改状态,但不会执行操作。经过一番研究,我在NativeBase中找到了一个手风琴,并在成功的小型测试之后尝试实现它。不幸的是,它无法识别出不是对象的数组索引值。因此,第一个问题与有关mobx动作的关闭和打开可折叠动作有关,第二个问题是无法从数组读取索引值的手风琴。如果任何人都可以帮助找到一种方法使数组中的相关对象动态折叠并显示值,
下面是相关的代码大杂烩,如果您需要更多代码,请随时提问,谢谢您的宝贵时间!
mobx文件:
import {observable, action} from 'mobx';
import {LayoutAnimation} from 'react-native'
class StateStorage {
@observable list= ['Category','','','']
@observable selectedMaterial=''
@observable materials = [
{
Specs:[
textCategory= 'Drain',
textSpec1='Usabley',
textSpec2='Healthy',
textSpec3='Bio'],
name: 'RYTT',
price: '$',
image: require("./Icons/Rain.jpg"),
spec1:require("./Icons/friendly.png"),
spec2:require("./Icons/Cutler.png"),
spec3:require("./Icons/logout.png"),
category:'',
icon: '',
uses:[
uses1='cecec',
uses2='- Cans' ,
uses3='- Jars',
uses4='- Signages',
pros:[
pros1='Lightweight',
pros2='Tough',
pros3='xsxxs',
pros4='cdccd',
],
cons:[
cons1='Inflated',
cons2='Can be sticky',
cons3='ejhcejccjhc',
cons4='dcd',
cons5='dc'],
expanded: true,
specCount:0,
userCount:0,
prosCount:0,
consCount:0,
x:0
},
{
Specs:[
textCategory= 'Drain',
textSpec1='Usabley', …
Run Code Online (Sandbox Code Playgroud) accordion collapsable react-native mobx-react react-native-flatlist
我正在尝试使用 Gmail API 发送电子邮件。但我收到这个错误
googleapi:错误 403:请求的身份验证范围不足。更多详细信息:原因:权限不足,消息:权限不足
我认为这可能与配置有关,我还遵循了 google 的 Go 快速入门,这里是 getClient 函数:
func getClient(config *oauth2.Config) *http.Client {
// The file token.json stores the user's access and refresh tokens, and is
// created automatically when the authorization flow completes for the first
// time.
tokFile := "token.json"
tok, err := tokenFromFile(tokFile)
if err != nil {
tok = getTokenFromWeb(config)
saveToken(tokFile, tok)
}
return config.Client(context.Background(), tok)
}
Run Code Online (Sandbox Code Playgroud)
这是发送的代码:
case "pass":
templateData := struct {
VerPass string
}{
VerPass: cont1,
}
emailBody, …
Run Code Online (Sandbox Code Playgroud) 我尝试将我的设置屏幕导入我的抽屉配置,以便在 app.js 上导入它们,但我收到一个错误,需要某个模块“699”。有人可以帮忙吗?
import React from 'react';
import { Platform, Dimensions} from 'react-native';
import { createDrawerNavigator, createAppContainer } from 'react-navigation';
import SettingScreen from '../Menu/SettingScreen'
const WIDTH = Dimensions.get('window').width;
const DrawerConfig = {
drawerWidth: WIDTH*0.83,
}
const DrawerNavigator = createDrawerNavigator(
{
Settings: {
screen: SettingScreen
},
},
DrawerConfig
);
export default createAppContainer(DrawerNavigator);
Run Code Online (Sandbox Code Playgroud) 初学者问题。错误说它找不到变量:“查看”
我编写了这段代码是为了将设计集成到我的代码中,但它给出了:“找不到变量:查看”我错过了什么
import React from 'react';
import {StyleSheet} from "react-native" ;
export default class MenuButton extends React.Component {
render() {
return (
<View menu={burger.menuIcon}>
</View>
)
}
}
const burger = StyleSheet.create({
menuIcon: {
color : 'rgba(255,255,255,0.0)',
top : 17 ,
height : 5 ,
width : 6 ,
position : 'absolute' ,
margin : 0,
left : 26
}});
Run Code Online (Sandbox Code Playgroud)
我希望一个没有错误的空白屏幕
frontend ×5
react-native ×5
javascript ×2
module ×2
reactjs ×2
accordion ×1
collapsable ×1
dart ×1
flutter ×1
gmail-api ×1
go ×1
google-api ×1
google-oauth ×1
html ×1
ionicons ×1
material-ui ×1
mobx-react ×1
opacity ×1
package.json ×1
react-router ×1
tabs ×1