React Native Responsive Font Size

前端 未结 14 1244
执念已碎
执念已碎 2020-11-29 16:39

I would like to ask how react native handle or do the responsive font. For example in iphone 4s i Have fontSize: 14, while in iphone 6 I have fontSize: 18.

14条回答
  •  一生所求
    2020-11-29 17:16

    We can use flex layout and use adjustsFontSizeToFit={true} for responsive font sizes.And the text would adjust according to the size of the container.

         {value}
        
    

    But in styles you need to put a fontsize as well only then will adjustsFontSizeToFit work.

        valueField: {
        flex: 3,
        fontSize: 48,
        marginBottom: 5,
        color: '#00A398',
    },
    

提交回复
热议问题