vertical Scrollview inside Carousal item #520
Unanswered
Amirali67691
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to add vertical Scrollview inside Carousal item but inside vertical Scrollview in not working. I want to enable on horizontal swiping on Carousal items and vertical scroll inside item of Carousal.
Here is my code:-
const {width,height}=Dimensions.get('window');
const SubscriptionCard = () => {
const [duration,setDuration]=useState('monthly');
const storeData=useSelector(getStoreSelect);
const packagesItems=useSelector(getPackagesSelect);
const handleChange=(value:boolean)=>{
if(value){
setDuration('yearly');
}
else{
setDuration('monthly')
}
}
const getMaxAnnualDiscount = useMemo(() => {
const memoizedMaxAnnualDiscount = (packagesItems:any) => {
const annualDiscounts = packagesItems.map((pack:any) => pack.annual_discount || 0);
return Math.max(...annualDiscounts);
};
return memoizedMaxAnnualDiscount;
}, []);
return (
<View style={{flexGrow:1,backgroundColor:'#fff'}}>
monthly
<Switch
trackColor={{ false:colors.lightGray, true: colors.darkBlue }}
thumbColor={duration=='yearly' ? colors.lightGreen : colors.lightGreen}
ios_backgroundColor={colors.lightGray}
onValueChange={handleChange}
value={duration=='yearly' ? true : false}
style={{borderRadius: hp('2.15%'),backgroundColor:'transparent' }}
/>
Annual
Up to {getMaxAnnualDiscount(packagesItems)}% Discount
)
}
Beta Was this translation helpful? Give feedback.
All reactions