我正在通过 TouchableOpacity 设计自定义按钮以响应本机。到目前为止,我已经尝试了不同的样式方法,但没有得到所需的设计。下面提到的是我试图解决的问题。
<TouchableOpacity style={styles.numericButton}>
<View>
<Text style={styles.numericButtonText}>1</Text>
</View>
</TouchableOpacity>
const styles = StyleSheet.create({
numericButton: {
margin:10,
padding:10,
backgroundColor:'#D3D3D3',
borderColor:'#000',
borderWidth:2,
borderRadius:5,
elevation:10,
shadowOffset: { width: 5, height: 5 },
shadowColor: "black",
shadowOpacity: 1,
shadowRadius: 5,
},
numericButtonText:{
fontSize:24,
fontWeight:'bold',
fontFamily:'Cochin'
}
});
结果:
我想像这样设置我的反应原生按钮