react-native - 如何设计 React-Native 按钮
问题描述
我是 react-native 的新手,我想设计这样一个按钮,我尝试并搜索但找不到答案
任何帮助,将不胜感激
解决方案
看看这个方法,使用 radiusBorder 你可以实现接近你正在寻找的东西:
import React from 'react';
import { View, StyleSheet, TouchableOpacity, Text } from 'react-native';
export default function NAME() {
return (
<TouchableOpacity>
<View style={styles.wrapperContainer}>
<View style={styles.Container}>
<Text>Foo</Text>
</View>
</View>
</TouchableOpacity>
);
}
const styles = StyleSheet.create({
Container: {
height: 50,
width: 100,
alignItems: 'center',
background: '#1f90f0',
borderRadius: 5,
justifyContent: 'center',
borderTopLeftRadius: 50,
borderLeftWidth: 2,
borderLeftColor: 'lightgray'
},
wrapperContainer: {
background: 'lightgray',
width: 100,
}
});
推荐阅读
- c# - 如何确保在 CefSharp 中执行 ExecuteScriptAsync
- vue.js - 商店用品 6 | 自定义字段为空
- java - Java 解密创建附加符号
- php - PHP函数从段落中删除第一句话
- javascript - Vue 和 Firebase RTDB 连接
- java - 在Android中有效地将图像上传到服务器
- google-chrome-devtools - Chrome DevTools:关闭 Lighthouse-Report
- python - Keras 生成器到 tf.data.Dataset
- c# - 当我为该条目设置变量并更改变量时,为什么列表中的条目会更改?
- python - CV 高度、宽度、通道到通道、高度、宽度