React native 使用水平滚动来响应本机底部模式
我正试图得到一个模态,使其看起来像下图。我尝试过各种模式和行动计划解决方案,但都没有完全正确。有人知道是否存在可以提供类似结果的解决方案吗?谢谢] 我一直在使用一个库中的动作表(下图),但它不能被自定义为水平滚动和使用自定义按钮。我还没有尝试创建我自己的组件,我首先想知道是否有人知道会产生相同结果的组件 关于iOS的定期行动单React native 使用水平滚动来响应本机底部模式,react-native,expo,React Native,Expo,我正试图得到一个模态,使其看起来像下图。我尝试过各种模式和行动计划解决方案,但都没有完全正确。有人知道是否存在可以提供类似结果的解决方案吗?谢谢] 我一直在使用一个库中的动作表(下图),但它不能被自定义为水平滚动和使用自定义按钮。我还没有尝试创建我自己的组件,我首先想知道是否有人知道会产生相同结果的组件 关于iOS的定期行动单 根据您的要求,这里有一个简单的工作示例。我使用的是模态组件 import React, { Component } from 'react' import { Sty
根据您的要求,这里有一个简单的工作示例。我使用的是模态组件
import React, { Component } from 'react'
import {
StyleSheet,
Text,
View,
TouchableOpacity,
ScrollView
} from 'react-native'
import Modal from 'react-native-modal'
export default class App extends Component {
constructor(props) {
super(props)
this.state = {
visible: false
}
}
showModal = () => this.setState({visible: true})
hideModal = () => this.setState({visible: false})
render() {
return (
<View style={{flex: 1}}>
<TouchableOpacity
onPress={this.showModal}
style={{alignSelf: 'center', marginTop: 50, backgroundColor: 'grey'}}
>
<Text>Touch Me</Text>
</TouchableOpacity>
<Modal
style={styles.modal}
isVisible={this.state.visible}
onBackdropPress={this.hideModal}
>
<ScrollView
horizontal={true}
>
{/* place your buttons here */}
<Text> Very Very Long String </Text>
</ScrollView>
</Modal>
</View>
)
}
}
const styles = StyleSheet.create({
modal: {
margin: 0,
backgroundColor: 'white',
height: 100,
flex:0 ,
bottom: 0,
position: 'absolute',
width: '100%'
}
})
import React,{Component}来自“React”
进口{
样式表,
文本,
看法
可触摸不透明度,
卷轴视图
}从“反应本机”
从“反应本机模态”导入模态
导出默认类应用程序扩展组件{
建造师(道具){
超级(道具)
此.state={
可见:假
}
}
showmotal=()=>this.setState({visible:true})
hideModal=()=>this.setState({visible:false})
render(){
返回(
摸摸我
{/*将按钮放在此处*/}
非常非常长的字符串
)
}
}
const styles=StyleSheet.create({
模态:{
保证金:0,
背景颜色:“白色”,
身高:100,
弹性:0,
底部:0,
位置:'绝对',
宽度:“100%”
}
})
您必须包含一些代码,以便人们可以看到您目前所拥有的帮助。您好,您是否找到了如何完成“票数”模式的解决方案?谢谢@rahul。这正是我想要的。