Content-Length: 300816 | pFad | https://docs.nativebase.io/migration/image
Playgroundfunction Example() {return <Center><Image source={{uri: "https://wallpaperaccess.com/full/317501.jpg"}} alt="Alternate Text" size="xl" /></Center>;}
Playgroundfunction Example() {return <><Heading mb="10" textAlign="center" mt="3">Image Sizes</Heading><ScrollView>{/* <Center mt="3" h="80"> */}<VStack space={2} justifyContent="center" alignItems="center" safeAreaTop // my={6}mb={6}>{["xs", "sm", "md", "lg", "xl", "2xl"].map(size => <Image key={size} size={size} resizeMode="cover" source={{uri: "https://wallpaperaccess.com/full/317501.jpg"}} alt={"Alternate Text " + size} />)}</VStack>{/* </Center> */}</ScrollView></>;}
Playgroundfunction Example() {return <Center><Image size={150} borderRadius={100} source={{uri: "https://wallpaperaccess.com/full/317501.jpg"}} alt="Alternate Text" /></Center>;}
Playgroundfunction Example() {return <Center><Image size={150} alt="fallback text" borderRadius={100} source={{uri: "https://-page-icon.png"}} fallbackSource={{uri: "https://www.w3schools.com/css/img_lights.jpg"}} /></Center>;}
Playground//@ts-nocheckfunction Example() {const myRef = React.useRef(null);React.useEffect(() => {if (myRef.current && myRef.current.setNativeProps) {const styleObj = {borderWidth: 4,borderRadius: 4,borderColor: "#22D3EE"};myRef.current.setNativeProps({style: styleObj});}}, [myRef]);return <Center><Image ref={myRef} source={{uri: "https://wallpaperaccess.com/full/317501.jpg"}} alt="Alternate Text" size="xl" /></Center>;}
Copyconst img = require('/public/me.jpg');// DO ✔<Imagesource={{ uri: img.default.src }}width={500}height={500}/>// DON'T ✘<Imagesource={img}width={500}height={500}/>
Fetched URL: https://docs.nativebase.io/migration/image
Alternative Proxies: