Skip to content

Issue with Top Padding in Text Component on Android (includeFontPadding : false not working🥹) #45660

@HyoJeong1019

Description

@HyoJeong1019

Description

This issue only occurs on Android.

After creating a React Native project and writing the Text component and ThemedText component respectively in the index.js file, I noticed that there is padding at the top of the default Text component.

I found that setting the includeFontPadding property to false is suggested as a solution to a similar problem. However, this only removes the bottom padding, and the top padding remains unaffected.

Could you please provide assistance on how to remove the top padding of the Text component as well? Any guidance or suggestions would be greatly appreciated.

Steps to reproduce

  1. Set up a React Native project.
  2. Use the Text component in the index.js file.
  3. Use the ThemedText component in the index.js file.
  4. Compare the UI of the two different components.

React Native Version

0.73.9

Affected Platforms

Runtime - Android

Output of npx react-native info

System:
  OS: macOS 13.6.2
  CPU: (8) arm64 Apple M1 Pro
  Memory: 96.94 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 21.7.1
    path: /opt/homebrew/bin/node
  Yarn:
    version: 1.22.22
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.5.0
    path: /opt/homebrew/bin/npm
  Watchman:
    version: 2024.03.25.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/hyojeong-cho/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 22.2
      - iOS 16.2
      - macOS 13.1
      - tvOS 16.1
      - watchOS 9.1
  Android SDK:
    API Levels:
      - "29"
      - "30"
      - "31"
      - "33"
      - "34"
    Build Tools:
      - 30.0.2
      - 30.0.3
      - 33.0.0
      - 33.0.1
      - 34.0.0
    System Images:
      - android-31 | Android TV ARM 64 v8a
      - android-31 | Android TV Intel x86 Atom
      - android-31 | AOSP ATD ARM 64 v8a
      - android-31 | AOSP ATD Intel x86_64 Atom
      - android-31 | ARM 64 v8a
      - android-31 | Intel x86_64 Atom
      - android-31 | Google TV ARM 64 v8a
      - android-31 | Google TV Intel x86 Atom
      - android-31 | Google APIs ARM 64 v8a
      - android-31 | Google APIs Intel x86_64 Atom
      - android-31 | Google Play ARM 64 v8a
      - android-31 | Google Play Intel x86_64 Atom
      - android-31 | Google APIs ATD ARM 64 v8a
      - android-31 | Google APIs ATD Intel x86_64 Atom
      - android-34 | Google APIs ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2022.3 AI-223.8836.35.2231.11005911
  Xcode:
    version: 14.2/14C18
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.11
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /Users/hyojeong-cho/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.9
    wanted: ^0.73.9
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Stacktrace or Logs

-

Reproducer

https://github.com/HyoJeong1019/rn-text

Screenshots and Videos

스크린샷 2024-07-25 오후 2 52 59

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions