App.js 1.14 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
import React from 'react';
import { StyleSheet, Text, View, TouchableOpacity } from 'react-native';

export default function App() {
  return (
    <>
				<View style={styles.header}>
						<Text style={styles.headerText}>RNAccessibilityName</Text>
				</View>
      <View style={styles.container}>
        <TouchableOpacity style={styles.button} accessible={true} accessibilityLabel="This is my accessibility label" accessibilityHint="And this is my accessibility hint">
          <Text>I have an accessibility description</Text>
        </TouchableOpacity>
        <TouchableOpacity style={styles.button}>
            <Text>Useless button with no accessibility description</Text>
        </TouchableOpacity>
      </View>
    </>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center',
  },

  button: {
    alignItems: 'center',
    backgroundColor: '#DDDDDD',
    padding: 10,
    marginBottom: 20,
  },

  header: {
    backgroundColor: '#008577',
    paddingHorizontal: 20,
	paddingVertical: 20,
	marginTop: 20,
  },
  headerText: {
    color: 'white',
  },
});