Blog Content

    티스토리 뷰

    RN ios, android 디바이스별 폰트 설정 관련

    안드로이드에서 fontweight가 있으면 설정이 ios만 되고 fontFamily 가 적용이 안된다.


    그래서 그런경우엔 보통

    import { Platform, StyleSheet } from 'react-native';


    fontWeight: Platform.OS === 'android' ? 'normal' : 'bold' 이렇게 처리한다.


    다른 예로


    import { Platform, StyleSheet } from 'react-native';


    const styles = StyleSheet.create({ height: Platform.OS === 'ios' ? 200 : 100 });

    '개발연습막쓰기 > React 개발연습 막쓰기' 카테고리의 다른 글

    [RN] - Device top height  (0) 2020.09.02
    [RN] hitSlop  (0) 2020.08.27
    RN 애러  (0) 2020.08.25
    map  (0) 2020.08.03
    [React Native Error] pod install 후 발생하는 에러 해결 방법  (0) 2020.07.25

    Comments