Felhasználói eszközök

Eszközök a webhelyen


oktatas:telefon:react_native:radiogomb

Különbségek

A kiválasztott változat és az aktuális verzió közötti különbségek a következők.

Összehasonlító nézet linkje

Előző változat mindkét oldalonElőző változat
oktatas:telefon:react_native:radiogomb [2025/03/07 19:25] – [Példa] adminoktatas:telefon:react_native:radiogomb [2025/03/08 07:15] (aktuális) – [Példa] admin
Sor 52: Sor 52:
  
  
 +</code>
 +
 +Egy lehetséges teljes kód:
 +
 +<code javascript App.js>
 +import { StatusBar } from 'expo-status-bar';
 +import { useState } from 'react';
 +import { StyleSheet, Text, View } from 'react-native';
 +import { RadioGroup } from 'react-native-radio-buttons-group';
 +
 +export default function App() {
 +  const [selectedId, setSelectedId] = useState(null);
 +  const radioButtons = [
 +    {
 +      id: '1',
 +      label: 'Option 1',
 +      value: 'option1',
 +    },
 +    {
 +      id: '2',
 +      label: 'Option 2',
 +      value: 'option2',
 +    },
 +    {
 +      id: '3',
 +      label: 'Option 3',
 +      value: 'option3',
 +    },
 +  ]
 +  return (
 +    <View style={styles.container}>
 +      <Text>Rádiógomb</Text>
 +      <View>
 +        <Text>{selectedId}</Text>
 +      </View>
 +
 +      <RadioGroup
 +        radioButtons={radioButtons}
 +        onPress={setSelectedId}
 +        selectedId={selectedId}
 +      />
 +
 +      <StatusBar style="auto" />
 +    </View>
 +  );
 +}
 +
 +const styles = StyleSheet.create({
 +  container: {
 +    flex: 1,
 +    backgroundColor: '#fff',
 +    alignItems: 'center',
 +    justifyContent: 'center',
 +  },
 +});
 </code> </code>
  
oktatas/telefon/react_native/radiogomb.1741371943.txt.gz · Utolsó módosítás: 2025/03/07 19:25 szerkesztette: admin