-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iPhone X selectionIndicatorImage #191
Comments
did you find a solution for this? |
No, still pending :( (Found another bug making a vertical transition though) |
Maybe it's a bug in iphone X. I will inform you when I've found a solution. |
I have the same problem but I got a bit closer using:
This makes the positioning correct but adds padding around it.. :/ Edit: Fixed by making the image 1 pixel less in height. |
@casperzandbergenyaacomm solution works for me. |
It appears
|
@casperzandbergenyaacomm and @tacovollmer I followed ur steps. but still getting some gap in all iPhone versions. Please suggest how to fill the gaps. |
I haven't been able to fill to the bottom @SureshChary. I'm interested to know if anyone did manage. |
@SureshChary I have the same as you and it works for me, are you sure the tabHeight is tabBar.frame.height? My code for the bar in the image.
Note: I do not use this library |
Yes, let tabHeight = tabBar.frame.height I tried your above code. But again it is failing in iPhone X 11.2. any idea? |
@SureshChary You need to call that code in the viewDidLayoutSubviews (after the height sizing for iPhone X) |
Perfect!! Worked and thanks @casperzandbergenyaacomm I feel iPhone X Tab UI is ugly bcoz of height-83. is it Ok for Apple? |
I would actually advise against using a background color on your tab bar buttons nowadays, they look off on the current generation of iPhones. A selected icon and unselected icon is a better way to show wether the tab is active. |
https://stackoverflow.com/a/46310166/3629513 let numberOfItems = CGFloat(tabBar.items?.count ?? 0) |
Having an issue trying to set the selectionIndicator Image.
self.tabBar.selectionIndicatorImage = UIImage.imageWithColor(UIColor.black, size: CGSize(width: tabBar.frame.width/CGFloat((tabBar.items?.count)!), height: tabBar.frame.height))
I create an image with a black background and this is what I get:
The text was updated successfully, but these errors were encountered: