Skip to content
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

Initial position for the first tab is not correct. #13

Open
nweaveahh opened this issue Sep 18, 2019 · 6 comments
Open

Initial position for the first tab is not correct. #13

nweaveahh opened this issue Sep 18, 2019 · 6 comments

Comments

@nweaveahh
Copy link

The initial position for the first tab
Screen Shot 2019-09-18 at 11 36 58 AM

When navigation between the tabs. The position will display correctly.

Screen Shot 2019-09-18 at 11 37 07 AM

@zdiovo
Copy link

zdiovo commented Oct 4, 2019

The initial position for the first tab
Screen Shot 2019-09-18 at 11 36 58 AM

When navigation between the tabs. The position will display correctly.

Screen Shot 2019-09-18 at 11 37 07 AM

me, too

@perteraul
Copy link
Member

@perteadrian, can you please take a look at this?

Sent with GitHawk

@Madrox24
Copy link

I have the same problem :(

@OleksiiShulzhenko
Copy link

I have the same.

@simonepercossi
Copy link

Hi guys,

i know it's not the best solution but it's work.

On SHCircleBarController.swift add the following code:

override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) let idx = 0 selectedIndex = idx let tabWidth = self.view.bounds.width / CGFloat(self.tabBar.items!.count) UIView.animate(withDuration: 0.3) { self.circleView.frame = CGRect(x: (tabWidth * CGFloat(idx) + tabWidth / 2 - 30), y: self.tabBar.frame.origin.y - 15, width: 60, height: 60) } UIView.animate(withDuration: 0.15, animations: { self.circleImageView.alpha = 0 }) { (_) in self.circleImageView.image = self.image(with: self.tabBar.items?[idx].image, scaledTo: CGSize(width: 30, height: 30)) UIView.animate(withDuration: 0.15, animations: { self.circleImageView.alpha = 1 }) } if let controller = viewControllers?[idx] { delegate?.tabBarController?(self, didSelect: controller) } }

@phoelapyae7
Copy link

phoelapyae7 commented Feb 22, 2020

Hola @nweaveahh @OleksiiShulzhenko @Madrox24
When the tab bar is initially loaded, the number of tab bar of tab bar's items is nil and the default value '4' is taken to keep running. So, the tab bar item is initially at wrong position. The best solution is to have a property for tabWidth inside controller and directly assign the value to it. Thanks! 😊😊😊

kamrul-cse added a commit to kamrul-cse/CircleBar that referenced this issue Jul 16, 2021
+ Can change tab position programatically
+ Circle now dynamic
+ Support up to iOS 14.5
+ Performance improved

Issues softhausHQ#7, softhausHQ#13, softhausHQ#14, softhausHQ#16, softhausHQ#18, softhausHQ#19, softhausHQ#25, softhausHQ#26 has been resolved.

Alhamdulillah!
perteadrian pushed a commit that referenced this issue Jul 18, 2021
+ Can change tab position programatically
+ Circle now dynamic
+ Support up to iOS 14.5
+ Performance improved

Issues #7, #13, #14, #16, #18, #19, #25, #26 has been resolved.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants