Skip to content

Commit

Permalink
fix: only offset bottom tab on iOS. fixes #8642
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Jul 28, 2020
1 parent 40e2dba commit d979dfd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/bottom-tabs/src/views/BottomTabBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,10 @@ export default function BottomTabBar({
left: safeAreaInsets?.left ?? defaultInsets.left,
};

const paddingBottom = Math.max(insets.bottom - 4, 0);
const paddingBottom = Math.max(
insets.bottom - Platform.select({ ios: 4, default: 0 }),
0
);

return (
<Animated.View
Expand Down

4 comments on commit d979dfd

@bbaoNg97
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I know what is the reason of subtracting 4 in iOS? what is the purpose of it?

@satya164
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bbaoNg97 to match how native iOS bottom tabs look

@bbaoNg97
Copy link

@bbaoNg97 bbaoNg97 commented on d979dfd Jun 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@satya164 but then according to design kit from apple https://www.figma.com/design/1bCJ0Gnx7hYtuT6j94SHVy/iOS-17-and-iPadOS-17-(Community)?node-id=0-3402&t=2o0GNuVRcn9RgZYI-0, the total height is 83, so assuming tab bar itself is 49, then the safe area should be 34
from the current code, i got bottom value of 34 from safe area inset, but then it subtracted 4, is this outdated?

Another reference
https://www.figma.com/design/C3YnALHr99GZ8aL9KEVOMM/iOS-14-UI-Kit-for-Figma-(Community)?node-id=362-16073&t=mKKDzpWl5Imiue31-0

@satya164
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bbaoNg97 maybe it changed. feel free to send a PR if it doesn't match anymore

Please sign in to comment.