Just how to eliminate lower tab bar boundary in React Navigating
Released on Jan 17, 2021
•
2 minutes read
•
Navigating plays an essential function in mobile applications and also the React Navigating collection does an outstanding work in offering an entirely personalized user interface for making use of various navigating patterns to Respond Indigenous applications.
Having the freedom to personalize tab bars with React Navigating, one personalized choice offered (relying on the UI layout of an application) is to eliminate the boundary from the Tab bar.
Right here is an instance of the boundary that is the default when the React Navigating Base Tabs collection is made use of to develop a tab bar.
For the presentation function, I am utilizing an Exposition task produced utilizing the expo-cli
command-line device. To develop a comparable brand-new Exposition task, you can perform the command and also select the tabs
choice.
exposition init yourProjectName
This exposition task includes a default base tab navigator whose setup can be discovered in the documents navigation/BottomTabNavigator. tsx
Personalize the TabBar
All-time Low Tab Bar React Navigating collection offers a things called screenOptions
to personalize a tab bar. This things includes props that can be made use of to use personalized designs and also among the common residential property it has actually is called tabBarStyle
This residential property is frequently made use of to transform the designs of the tab bar, as an example, by using the backgroundColor
designs’ residential property.
To eliminate the boundary, include the screenOptions
prop and also inside it, include a tabBarStyle
residential property called borderTopWidth
with a worth 0
1< Right here is the result: Do note that this residential property can likewise be made use of to raise the size of the leading boundary. Getting rid of darkness on Android Tool
After using this tabBarStyle residential property, the size of the leading boundary is gotten rid of from an Android gadget. Nevertheless, there is a darkness on top boundary of the tab bar that continues to be.
To eliminate this darkness, established the altitude to 0:
1
tabBarStyle: { 2
borderTopWidth: 0 ,
3 altitude
: 0 4
} Resource code offered at GitHub
I’m a software program programmer and also a technological author. In this blog site, I cover Technical creating, Node.js, Respond Indigenous and also Exposition.
Presently, operating at Exposition. Formerly, I have actually functioned as a Programmer Supporter, and also Elderly Web content Programmer with business like Draftbit, Vercel and also Crowdbotics.