小编Lav*_*aju的帖子

在本地视图中单击地图视图上的任意位置时如何放置标记

我的要求是,我需要在地图视图上显示标记。当用户单击地图视图上的任意位置时,还需要获取放置标记的坐标(纬度和经度)。

我在这里尝试的是:

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)

react-native react-native-android react-native-maps

5
推荐指数
1
解决办法
2012
查看次数

react-native中基于设备的SplitView(仅适用于平板电脑和iPad)

我正在研究示例应用程序。我已经基于View Container设计了我的应用程序。通过使用以下情况,我以手机(iOS / Android)的肖像模式设计了我的应用程序,还为iPad /平板电脑设计了肖像模式和LandScape模式。

现在,我想在纵向和横向模式下为iPad和平板电脑设计splitView。我在Google上进行了搜索,但未找到任何信息。我想知道如何在Android和iOS中设计它(拆分视图)。

splitview react-native react-native-android react-native-ios

5
推荐指数
1
解决办法
442
查看次数

收到此错误:无法加载 .android/repositories.cfg

无法加载文件 /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

react-native react-android

5
推荐指数
1
解决办法
4343
查看次数

如何使用 Vuetify 数据表在鼠标悬停在表格上时显示按钮

我是新开始使用 Vue.js 和 Vuetify 工作。这里我使用 v-data-table 组件来显示表数据。是否有一个选项,当用户用鼠标悬停(悬停)表格时,他可以看到表格中的按钮?或者如果我选择行隐藏显示按钮上的行值。如果我选择多个,那么我们需要在表格标题部分显示按钮(例如标题标题禁用显示按钮。)我像这样共享图像。在此输入图像描述![在此输入图像描述在此输入图像描述] 2

vue.js nuxt.js vuetify.js

5
推荐指数
1
解决办法
6414
查看次数

我们如何在 react-native 中设计 Arrow 卡

我正在开发一个示例应用程序,在这个应用程序中需要使用 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)

这我需要像这种类型的图像,这是引用图像:

在此处输入图片说明

css react-native react-native-android react-native-ios

4
推荐指数
1
解决办法
6069
查看次数

当样式在范围内时不应用 Vuetify 样式

我正在使用 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)

vue.js vuetify.js

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

React-Native:当我单击On multiple Positions(如X和Y坐标)时,如何获得多个标记图像

我正在使用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只显示坐标:

在此输入图像描述

我想要这种类型同时显示图像或图标的位置

在此输入图像描述

任何人都可以帮我解决这个问题.

react-native

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

如何在反应原生android中设置视频启动画面

我正在开发示例应用程序,但我想要视频启动画面(在此视频持续时间为 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)

react-native react-native-android

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

文本输入没有像 react-native 中的文本区域那样显示

我没有让文本区域占位符进入中心,但我想要占位符一侧的顶部,如下图所示。请您建议如何基于设计 在此处输入图片说明

这是代码:

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)

javascript react-native

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