V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  razor1895  ›  全部回复第 3 页 / 共 16 页
回复总数  317
1  2  3  4  5  6  7  8  9  10 ... 16  
前端岗位有吗
支持以下
@GOKOG 咸鱼,怡辰数码,我两周前买的,现在貌似我这款没货了
@qinyq 咸鱼,怡辰数码,我两周前买的,现在貌似我这款没货了
1-3 年是硬性规定吗,7 年工作经验接受不
@yhxx 刚入手一个监管机,8200 ,m1 pro 10 + 16 核 32g 内存 512g 固态
178 天前
回复了 owen800q 创建的主题 程序员 react native 如何实现这样的底部导航栏
这是一个精简版本的实现

import { useEffect } from 'react';
import { Platform, StyleSheet, TouchableOpacity, View } from 'react-native';
import FastImage from 'react-native-fast-image';
import { trigger } from 'react-native-haptic-feedback';

import { BlurView } from '@react-native-community/blur';
import { BottomTabBarProps } from '@react-navigation/bottom-tabs';
import { useQueryClient } from '@tanstack/react-query';

import { TAB_BAR_HEIGHT } from '@/styles';
import { p2d } from '@/utils';
import { pubsub } from '@/utils/pubsub';

import { Badge } from './Badge';

const TabBarIconMap = [
{
inactive: require('@/assets/icons/icon-crushes.png'),
active: require('@/assets/icons/icon-crushes-focused.png'),
style: {
width: p2d(24),
height: p2d(17),
},
},
{
inactive: require('@/assets/icons/icon-news.png'),
active: require('@/assets/icons/icon-news-focused.png'),
style: {
width: p2d(23),
height: p2d(18.596),
},
},
{
inactive: require('@/assets/icons/icon-confessions.png'),
active: require('@/assets/icons/icon-confessions-focused.png'),
style: {
width: p2d(18.35),
height: p2d(17),
},
},
{
inactive: require('@/assets/icons/icon-profile.png'),
active: require('@/assets/icons/icon-profile-focused.png'),
style: {
width: p2d(11),
height: p2d(17),
},
},
];

const TabBarIcon = ({
focused,
index,
tabBarBadge,
}: {
focused: boolean;
index: number;
tabBarBadge?: string | number;
}) => {
const map = TabBarIconMap[index];
return (
<View>
<FastImage
source={focused ? map.active : map.inactive}
style={map.style}
resizeMode='contain'
/>
<Badge visible={!!tabBarBadge} style={styles.badge}>
{tabBarBadge}
</Badge>
</View>
);
};

let showedInviteModal = false;

export function TabBar({ state, descriptors, navigation }: BottomTabBarProps) {
// @ts-ignore
const bottom = global.bottomInset || 0;
const queryClient = useQueryClient();

useEffect(() => {
const disposer = pubsub.subscribe('have_shown_swipe_modal', () => {
showedInviteModal = true;
});

return disposer;
}, []);

return (
<View style={[styles.container, { bottom: Math.max(bottom, 10) }]}>
{Platform.OS === 'ios' && (
<BlurView blurType='xlight' blurAmount={2} style={StyleSheet.absoluteFillObject} />
)}
{state.routes.map((route, index) => {
const { options } = descriptors[route.key];

const isFocused = state.index === index;

const onPress = () => {
const event = navigation.emit({
type: 'tabPress',
target: route.key,
canPreventDefault: true,
});
trigger('impactMedium');

if (!isFocused && !event.defaultPrevented) {
// The `merge: true` option makes sure that the params inside the tab screen are preserved
navigation.navigate({ name: route.name, merge: true });
}
};

return (
<TouchableOpacity
key={String(index)}
accessibilityRole='button'
accessibilityState={isFocused ? { selected: true } : {}}
accessibilityLabel={options.tabBarAccessibilityLabel}
testID={options.tabBarTestID}
onPress={onPress}
style={styles.item}
>
<TabBarIcon focused={isFocused} index={index} tabBarBadge={options.tabBarBadge} />
</TouchableOpacity>
);
})}
</View>
);
}

const styles = StyleSheet.create({
container: {
position: 'absolute',
// bottom: 0,
// left: 0,
height: TAB_BAR_HEIGHT,
flexDirection: 'row',
// backgroundColor: 'transparent',
backgroundColor: 'rgba(255,255,255,0.3)',
width: p2d(234),
alignSelf: 'center',
alignItems: 'center',
borderRadius: p2d(10),
overflow: 'hidden',
},
item: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
icon: {
width: p2d(18),
height: p2d(18),
},
badge: {
position: 'absolute',
right: p2d(-5),
top: p2d(-4),
},
});

自己实现 ui 即可
178 天前
回复了 owen800q 创建的主题 程序员 react native 如何实现这样的底部导航栏
192 天前
回复了 vaaagle 创建的主题 汽车 买车送女朋友,求推荐,预算是落地 16w 内
@burstlinking 零跑 c11 + 1 ,性价比是真高
留个眼,最近正好也在看扫拖一体机
204 天前
回复了 williamjing 创建的主题 Apple 来说说 macOS 14 Sonoma 吧。
@i979491586 #2 iOS 打包正常,我之前用 beta 版本 xcode 打包就遇到一个问题,无法应用商店提审,后来为了提审核不得不降回 Ventura ,今天刚更新,一点问题都没有
212 天前
回复了 Anis099 创建的主题 酷工作 [远程] 直播服务端开发,月薪 20K-35K
接收转 go 吗,只有语言不符合
之前在淘宝 diy 显示器的店买了一个 4k 60hz 的镜面屏,显示效果挺惊艳的,面板应该是京东方的 n60 还是 n50 忘记了,现在应该有更好的选择
274 天前
回复了 shunwei 创建的主题 汽车 15 万左右的车, 有推荐的吗? 性价比高点的
@cpsony 零跑 + 1
275 天前
回复了 NoString 创建的主题 北京 分享一下 2023 北京摩托的购买和骑行感受
我 19 年半的居住证就 200 ,那时候还能淘宝找,直接搜跑腿代办就行
@jimor 买一个问界小鹏这样的有城市驾驶辅助的车,跟车距离设置到最近,然后就可以放松了
289 天前
回复了 tangjinzhou 创建的主题 程序员 自由职业后第一个 saas 产品发布了
https://form.antdv.com/price 想看下价格方案,结果 404 了
304 天前
回复了 qsnow6 创建的主题 问与答 为什么在高速路上保持车距这么难?
@cyrivlclth #11 我同事上绕城直接走应急,哪有摄像头都十分熟悉了,他 20 分钟走的路程我要花 30 分钟
羡慕广州的
1  2  3  4  5  6  7  8  9  10 ... 16  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2732 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 40ms · UTC 12:51 · PVG 20:51 · LAX 05:51 · JFK 08:51
Developed with CodeLauncher
♥ Do have faith in what you're doing.