亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

在React Native中為gorhom底部表單顯示陰影。
P粉148434742
P粉148434742 2023-07-27 23:12:57
0
1
717
<p>我正在使用gorhom/react-native-bottom-sheet函式庫(kù)。我想在使用者向上或向下滑動(dòng)底部表單時(shí)顯示陰影框。如何實(shí)現(xiàn)這一點(diǎn)?是否可能?目前我已經(jīng)設(shè)定在isOpen時(shí)顯示,但我希望在滑動(dòng)時(shí)顯示。我還嘗試將其包裝在Touchable元件中,當(dāng)isPressed為true時(shí)顯示陰影框,但在移動(dòng)底部表單時(shí)它並沒(méi)有起作用。 </p> <pre class="brush:php;toolbar:false;">export default function BottomSheet() { const [isPressed, setIsPressed] = useState(false); const { t } = useTranslation(); const [isOpen, setIsOpen] = useState(false); const bottomSheetModalRef = useRef(null); const snapPoints = ["50%"]; function handlePresentModal() { bottomSheetModalRef.current?.present(); setTimeout(() => { setIsOpen(true); }, 100); } return ( <> <Button title="Present Modal" onPress={handlePresentModal} /> <BottomSheetModalProvider> <StatusBar style="auto" /> <BottomSheetModal ref={bottomSheetModalRef} index={0} snapPoints={snapPoints} handleComponent={CustomHandler} onDismiss={() => setIsOpen(false)} > <Spacer size={30} /> <BottomSheetScrollView contentContainerStyle={styles.contentContainer}> //Content here </BottomSheetScrollView> </BottomSheetModal> </BottomSheetModalProvider> {isOpen && <ShadowBox />} </> ); } const styles = StyleSheet.create({ contentContainer: { paddingHorizo??ntal: 16, paddingBottom: 100, }, });</pre> <p><br /></p>
P粉148434742
P粉148434742

全部回覆(1)
P粉311089279

是的,這是可能的。你需要使用這個(gè)函式庫(kù)來(lái)為任何元件添加陰影效果。

Click this link for library

#

如果有任何需要幫助的地方,請(qǐng)告訴我!

最新下載
更多>
網(wǎng)站特效
網(wǎng)站源碼
網(wǎng)站素材
前端模板