我的要求是,我需要在地图视图上显示标记。当用户单击地图视图上的任意位置时,还需要获取放置标记的坐标(纬度和经度)。
我在这里尝试的是:
class Maps extends React.Component {
constructor(props) {
super(props);
this.state = {
region: {
latitude: LATITUDE,
longitude: LONGITUDE,
latitudeDelta: LATITUDE_DELTA,
longitudeDelta: LONGITUDE_DELTA
},
marker: {
latlng: {
latitude: 17.6868,
longitude: 83.2185,
latitudeDelta: LATITUDE_DELTA,
longitudeDelta: LONGITUDE_DELTA
}
}
};
}
onMapPress(e) {
alert("coordinates:" + JSON.stringify(e.nativeEvent.coordinate));
this.setState({
marker: [
{
coordinate: e.nativeEvent.coordinate
}
]
});
}
handleMarkerPress(event) {
const markerID = event.nativeEvent.identifier;
alert(markerID);
}
render() {
return (
<MapView
identifier={"1"}
ref={component => (this.map = component)}
provider={this.props.provider}
style={styles.map}
region={this.state.region}
onPress={this.onMapPress.bind(this)}
//onPress={(event) => …Run Code Online (Sandbox Code Playgroud) 我正在研究示例应用程序。我已经基于View Container设计了我的应用程序。通过使用以下情况,我以手机(iOS / Android)的肖像模式设计了我的应用程序,还为iPad /平板电脑设计了肖像模式和LandScape模式。
在Android中,我遵循了这种情况
在iOS中,我遵循这种情况
Xcode -> general -> Development info -> Device Orientation并选择PortraitiPhone和Portrait , LandscapeLeft and LandScapeRightiPad。现在,我想在纵向和横向模式下为iPad和平板电脑设计splitView。我在Google上进行了搜索,但未找到任何信息。我想知道如何在Android和iOS中设计它(拆分视图)。
splitview react-native react-native-android react-native-ios
无法加载文件 /Users/MyName/.android/repositories.cfg。
FAILURE:构建失败,出现异常。
出了什么问题:配置项目“:app”时出现问题。
无法解析配置“:app:_debugApk”的所有依赖项。配置项目 ':urbanairship-react-native' 时出现问题。无法解析配置 ':urbanairship-react-native:_debugPublishCopy' 的所有依赖项。找不到与 com.facebook.react:react-native:[0.40,) 匹配的任何版本。不匹配的版本: 0.20.1 0.20.0 0.19.1 0.19.0 0.18.0 + 12 more 需要:Koopi 客户:urbanairship-react-native:未指定
尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。
构建失败
总时间:15.647 秒 无法在设备上安装应用程序,请阅读上面的错误了解详情。确保您有一个正在运行的 Android 模拟器或已连接的设备并已设置您的 Android 开发环境:https : //facebook.github.io/react-native/docs/android-setup.html
我正在开发一个示例应用程序,在这个应用程序中需要使用 Arrow 卡来提供显示卡。我尝试过基于本机形状的反应,但我没有得到输出。
假设如果提供的文本自动增加,箭头设计形状也会增加
这是我的代码:
<View style={styles.container}>
<View style={{ flex: 0.1, backgroundColor: "blue" }} />
<View
style={{
flex: 0.9,
backgroundColor: "green",
justifyContent: "center",
alignItems: "center"
}}
>
<View style={styles.baseTop} />
<View style={styles.baseBottom} />
</View>
</View>
baseTop: {
borderBottomWidth: 35,
borderBottomColor: "red",
borderLeftWidth: 50,
borderLeftColor: "transparent",
borderRightWidth: 50,
borderRightColor: "transparent",
height: 0,
width: 0,
left: 0,
top: -35,
position: "absolute"
},
baseBottom: {
backgroundColor: "red",
height: 55,
width: 100
}
Run Code Online (Sandbox Code Playgroud)
这我需要像这种类型的图像,这是引用图像:
我正在使用 Vue.js,我应用了基于 v-data-table 类的检查,我给出了样式但没有应用。
<style lang="scss" scoped>
.v-toolbar__title {
color: indigo;
}
v-data-table-header{
background: rgba(0, 0, 0, .05);
}
tbody tr:nth-of-type(odd) {
background-color: rgba(0, 0, 0, .05);
}
</style>
Run Code Online (Sandbox Code Playgroud) 我正在使用React native开发一个示例应用程序.实际上,当我在图像上单击特定位置时,获取对应的x和y坐标.但是在该位置我想要多次显示标记和多个位置
这是我的显示代码:
return (
<View style={styles.container}>
<TouchableOpacity onPress={(evt) => this.handlePress(evt)}>
<Image source={require('./back1.jpg')} style={{resizeMode:'cover'}}>
</Image>
</TouchableOpacity>
</View>
);
Run Code Online (Sandbox Code Playgroud)
我的OnPress功能是:
handlePress(evt){
Alert.alert(`x coord = ${evt.nativeEvent.locationX}`);
Alert.alert(`y coord = ${evt.nativeEvent.locationY}`);
}
Run Code Online (Sandbox Code Playgroud)
这是我的ScreenShot只显示坐标:
我想要这种类型同时显示图像或图标的位置
任何人都可以帮我解决这个问题.
我正在开发示例应用程序,但我想要视频启动画面(在此视频持续时间为 8 秒),实际上我正在设置启动画面页面,但现在我想设置为视频启动画面。
splashPage.js 文件
这是我的代码。从'react-native-video'导入视频;
//import Main from './main';
import LoginScreen from './App/Components/login.js';
class SplashPage extends Component {
componentWillMount () {
var navigator = this.props.navigator;
setTimeout (() => {
navigator.replace({
component: LoginScreen,
// <-- This is the View you go to
});
}, 5000); //<-- Time until it jumps to "MainView"
}
render () {
return (
<View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}>
<View>{StatusBar.setBackgroundColor('black', true)}</View>
<Video source={require('./images/splashVideo.mp4')}
style={{position: 'absolute',
top: 0,
left: 0,
right: 0,
bottom: 0,
opacity: …Run Code Online (Sandbox Code Playgroud) 我没有让文本区域占位符进入中心,但我想要占位符一侧的顶部,如下图所示。请您建议如何基于设计

这是代码:
textInput: {
borderRadius: 5,
borderWidth: 1,
height: Platform.OS === "ios" ? 60 : 80,
fontSize: 16,
paddingHorizontal: 10,
marginHorizontal: 15,
padding: 10,
marginTop: 8
},
<TextInput
placeholder="Comment Here"
blurOnSubmit={false}
returnKeyType={"go"}
style={styles.textInput}
multiline={true}
numberOfLines={20}
underlineColorAndroid={"transparent"}
autoCapitalize={"none"}
autoCorrect={false}
onChangeText={this.handleChange.bind(
this,
"comment"
)}
ref={input => {
this.inputs["four"] = input;
}}
onSubmitEditing={() => {
this.submitOurView_Method();
}}
value={this.state.contactInfo_View.comment}
/>
Run Code Online (Sandbox Code Playgroud)