我正在使用 QML 开发 python 桌面应用程序。
我的 QML 文件中有这个:
SplitView {
anchors.fill: parent
orientation: Qt.Horizontal
Rectangle {
color: "#272822"
id: cameraRectangle
width: window.width / 2
Item {
//more stuff
}
Item {
Rectangle {
anchors.top: cameraRectangle.bottom
}
}
}
Rectangle {
//Rectangle info.
}
}
Run Code Online (Sandbox Code Playgroud)
我收到错误“QML 矩形:无法锚定到不是父项或同级项的项目。” 在我正在做anchors.top的线上:cameraRectangle.bottom。我会假设外部矩形是内部矩形的父级?
我在网上搜索过,如下所示: http: //doc.qt.io/qt-5/qtquick-visualcanvas-visualparent.html,他们似乎没有做任何不同的事情?
难道是我使用的QtQuick版本的问题?
进口情况如下:
import QtQuick 2.6
import QtQuick.Controls 2.0
import QtQuick.Controls 1.4
import QtQuick.Controls.Material 2.0
import QtQuick.Window 2.0
Run Code Online (Sandbox Code Playgroud)
我感谢您的帮助。
不幸的是,我的ScrollView没有滚动,我尝试过这里发布的解决方案:React-Native,Scroll View Not Scrolling,但它似乎没有帮助.有没有人遇到这个,能够帮助我吗?
<View style={styles.container}>
<View style={{ flex: 1 }}>
<ImageBackground
style={{ height: "100%", width: "100%" }}
source={{ uri: IMAGE }}
resizeMode="cover"
>
<Overlay styleName="fill-parent">
<Title>Title</Title>
{this.renderOffer()}
{this.renderSwitch()}
</Overlay>
</ImageBackground>
</View>
<View style={{ backgroundColor: "white", flex: 1 }}>
<View style={{ paddingTop: 5 }}>
<Title styleName="md-gutter-bottom h-center">Title</Title>
</View>
<ScrollView
style={{
backgroundColor: "white",
flex: 1,
marginBottom: 5,
marginTop: 0
}}
>
<Caption style={{ margin: 10 }}>
A Stop on the Salt Route 1000 B.C. As they rounded a bend …Run Code Online (Sandbox Code Playgroud)我收到错误消息“找不到变量uploadImageAsync”
uploadImageAsync = async (uri) => {
console.log("In upload image asnyc!");
}
Run Code Online (Sandbox Code Playgroud)
这就是我所说的。
_handleImagePicked = async pickerResult => {
let uploadResponse, uploadResult;
this.setState({ uploading: true });
if (!pickerResult.cancelled) {
uploadResponse = await uploadImageAsync(pickerResult.uri);
uploadResult = await uploadResponse.json();
this.setState({ image: uploadResult.location });
}
this.setState({ uploading: false });
};
Run Code Online (Sandbox Code Playgroud)
我该如何解决?
到目前为止,我已经尝试过:
async function uploadImageAsync(uri) {
Run Code Online (Sandbox Code Playgroud)
我也尝试过:
async uploadImageAsync(uri) {
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用href将我带到一个特定的div,其id与对应的内容相对应a href="#1">.
作为一个例子,我有以下三个div.
<ul>
<li id="1" class="cd-single-item cd-active">
<div class="cd-caption two-third-width">
<h2>1.</h2>
<div style="height: 100px">
</div>
</div>
</li>
<li id="2" class="cd-single-item cd-not-visible cd-move-right">
<div class="cd-caption two-third-width">
<h2>2.</h2>
<div style="height: 100px">
</div>
</div>
</li>
<li id="3" class="cd-single-item cd-not-visible cd-move-right">
<div class="cd-caption two-third-width">
<h2>3.</h2>
<div style="height: 100px">
</div>
</div>
</li>
</ul>Run Code Online (Sandbox Code Playgroud)
当我将网站置于移动模式时,href正确转到相应的列表项.但是,在普通桌面模式下,它不会.
这里有一个链接到该网站.https://what-is-wrong-with-this-css.herokuapp.com/
链接应该来自左上角的菜单图标.了解它如何正确转到移动设备中的列表项但不在桌面设备中.有谁知道这里的任何快速修复.
谢谢,
在我的本机应用程序中,我将用户信息安全地保存在钥匙链上,以便他们登录一次后,我保存信息,然后下次用户来时,信息已经存在,因此用户不会需要登录。
问题是我在 componentDidMount 中进行了检查,然后如果用户之前从未登录过或在上次访问时注销过,我会将他们重定向到 loginScreen,如下所示:
componentDidMount() {
//Need to check if they've signed in before by checking the USER_INFO.
SecureStore.getItemAsync("USER_INFO").then(response => {
//Have they signed in before?
if (response !== undefined) {
//yes.
//continue with app stuff.
}
else {
//Not logged in before need to go to login.
const resetAction = NavigationActions.reset({
index: 0,
actions: [
NavigationActions.navigate({ routeName: 'Login', params: this.props.navigation.state.params }),
]
});
this.props.navigation.dispatch(resetAction);
}
});
}Run Code Online (Sandbox Code Playgroud)
问题是我收到一条警告“警告:只能更新已安装或正在安装的组件。这通常意味着您在未安装的组件上调用了 setState、replaceState 或 forceUpdate。这是一个禁止操作。'。这是有道理的,因为我在屏幕呈现之前重定向,但问题是,我应该在哪里执行这些检查?
谢谢
尝试在iOS模拟器上运行代码时出现以下错误。该错误指出“元素类型无效:应使用字符串(对于内置组件),但得到:未定义。您可能忘记了从定义文件中导出组件。”
我在其他人的帖子上看到过同样的问题,他们需要在文件末尾添加“导出默认应用程序”或在类的声明中使用“导出默认类”。
我正在关注的教程是https://medium.com/@gurusundesh/getting-started-with-react-native-mapview-5e0bd73aa602。从那以后,这可能是该文章过时了,本机也发生了变化。
任何有关如何解决此问题的建议将不胜感激。
谢谢
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
Platform,
StyleSheet,
Text,
View
} from 'react-native';
import { MapView } from 'react-native-maps';
const instructions = Platform.select({
ios: 'Press Cmd+R to reload,\n' +
'Cmd+D or shake for dev menu',
android: 'Double tap R on your keyboard to reload,\n' +
'Shake or press menu button for dev menu',
});
class App extends Component { …Run Code Online (Sandbox Code Playgroud)javascript ×5
react-native ×4
asynchronous ×1
css ×1
html ×1
jquery ×1
qml ×1
qt ×1
qtquick2 ×1
scrollview ×1