1 Star 0 Fork 0

帆船/react-native-action-button

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
shared.js 972 Bytes
一键复制 编辑 原始数据 按行查看 历史
蔡奕富 提交于 4年前 . cm1
import {
Platform,
TouchableOpacity,
TouchableNativeFeedback
} from "react-native";
export const DEFAULT_ACTIVE_OPACITY = 0.85;
export const shadowStyle = {
shadowOpacity: 0.35,
shadowOffset: {
width: 0,
height: 5
},
shadowColor: "#000",
shadowRadius: 3,
elevation: 5
};
export const alignItemsMap = {
center: "center",
left: "flex-start",
right: "flex-end"
};
export const isAndroid = Platform.OS === "android";
export function getTouchableComponent(useNativeFeedback) {
// if (useNativeFeedback === true && isAndroid === true) {
// return TouchableNativeFeedback;
// }
return TouchableOpacity;
}
export function touchableBackground(color, fixRadius) {
if (isAndroid) {
if (Platform["Version"] >= 21) {
return TouchableNativeFeedback.Ripple(
color || "rgba(255,255,255,0.75)",
fixRadius
);
} else {
TouchableNativeFeedback.SelectableBackground();
}
}
return undefined;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/dafasdf/react-native-action-button.git
git@gitee.com:dafasdf/react-native-action-button.git
dafasdf
react-native-action-button
react-native-action-button
master

搜索帮助