[React-Native] 안드로이드에서 기본 텍스트 패딩값 제거

승환·2024년 1월 30일
0

React-Native_Issue

목록 보기
8/8

상황 :

  • 외부의 커스텀 폰트를 적용 시켰더니 line-height 를 적용 시키지 않았는데 글자간의 상하 간격이 크게 차이난다.
  • 결정적으로 ios와 스타일 통일이 안됨

원인 :

  • 다음과 같이 별도의 설정을 해주지 않는다면 Android에서는 TextView이 기본 패딩값이 적용된다.

해결 :

  • style에 include-font-padding: false 를 선언 해주면 된다.
// ex) styled-components
export const Label = styled.Text`
  include-font-padding: false;
	// ...
`;

// ex) styleSheet
const styles= styleSheet.create({
	text: {
		includeFontPadding: false;
	}
})
profile
반갑습니다~

0개의 댓글