Code Monkey home page Code Monkey logo

Comments (1)

seb-zabielski avatar seb-zabielski commented on September 13, 2024

Hey, I could be wrong, but it looks like there is no easy way to solve your problem. I haven't found a way to override the top style. I think in your case it is also problematic that the icon container has a fixed height (it is based on the Material Design specification). Therefore, the icon is not aligned correctly because your icon size is 30dp, while in the Material specification is 24dp. To have an aligned icon, you can either set the icon size to 24dp or try adjusting the position with a negative value for the top style if the icon, for example :

<Tab.Screen
  name="Home"
  component={HomeScreen}
  options={{
    tabBarIcon: ({ color, size }) => {
      return (
        <Icon 
          name="home" 
          size={size} 
          color={color} 
          style={{ top: -4 }} // <- THIS
        />
      );
    },
  }}
/>

However, I cannot guarantee that this will not cause other unforeseen problems

I know that these are not the best solutions. Maybe at least one of them will at least be enough until someone else provides a better one?

from react-native-paper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.