Closed ghimireprashant closed 5 years ago
Hello,
I am not sure I understand. Could you please post screenshots of the problem and perhaps mock ups of what you want to happen?
Also, please format your code.
Thanks
i will upload demo project shortly.
I prefer we start with a description for your problem. I may not have time to look at the demo project. Thanks
something wrong with tabbar when i import library there is while inset in controller.
i have uploaded some screen short.
i want to present custom popup view in tabbar but it default when i use this code
self.tabBarController?.presentPopupBar(withContentViewController: popupContentController, animated: false, completion: nil)
but when i change this code to this
self.presentPopupBar(withContentViewController: popupContentController!, animated: false, completion: nil)
it is diplayed only in that controller i.e not in other controller that is in tabbar.
also i want to change height dynamicly i have used
self.preferredContentSize = CGSize(width: -1, height: self.view.frame.height - self.adView.frame.height) containingPopupBar.setNeedsLayout() containingPopupBar.layoutIfNeeded()
it change the height for popup but the inset remains in that controller.
i have attached image.
Thanks.
So, if I understand correctly, you are seeing two different issues:
Are you able to reproduce these issues in the sample project? Also, please make sure you are using the latest version of the framework. I've seen this tab bar issue in the past, and it no longer reproduces in the latest versions.
I just tested on the demo project. I displayed the map scene custom popup bar controller in the music app, which is presented on a tab bar controller. I then changed the height 2 seconds after presentation. Everything worked as expected:
yap it in the demo sample project. the tab bar laid out before presenting the popup bar. my problem is when i custom pop up bar in the tab bar it shows default popup bar not the custom bar that I have created. and also when I change the height of the custom popup bar in run time these the insect remains in controller. can you please provide me the code use you used to present in tabbar? thanks
i missed this part
tabBarController?.popupBar.customBarViewController = customMapBar
and was using
popupBar.customBarViewController = customMapBar
how can get access to custom view propert from other controller ? like title image and progress bar.
thanks.
Custom bars do not have images, progress bars or any other of the standard views. It's up to you to implement them.
is it there any way to cast popup bar controller? ie
if let popUpItem = self.popupBar.customBarViewController as? CustomPopupBarViewController { popUpItem.imageView.image = albumArt }
or
if let popUpItem = self.tabBarController?.popupBar.customBarViewController as? CustomPopupBarViewController { popUpItem.imageView.image = albumArt }
thanks
Yes, of course.
@LeoNatan I am trying to set customBarViewController
like below.
let customPlayerBar = PlayerPopUpBarVC.instantiate()
self.tabBarController?.popupBar.customBarViewController = customPlayerBar
self.tabBarController?.presentPopupBar(withContentViewController: vc, openPopup: true, animated: true, completion: nil)
This does work however the problem is when I'm trying to get that like this code
if let customItem = self.popupBar.customBarViewController as? PlayerPopUpBarVC {
customItem.songTitleLabel.text = name
customItem.songArtistLabel.text = artist
}
I got nil
for PlayerPopUpBarVC
. Any idea why?
I think you are trying to change the incorrect controller’s popup item.
@LeoNatan class PlayerPopUpBarVC: LNPopupCustomBarViewController
. I have given PlayerPopUpBarVC
as customBarViewController
. Can you please elaborate more?
You have to retrieve the popupBar in his container:
if let customItem = self.tabBarController?.popupBar.customBarViewController as? PlayerPopUpBarVC {
customItem.songTitleLabel.text = name
customItem.songArtistLabel.text = artist
}
@iDevelopper Still got nil
@LeoNatan Any solution for this pls? self.tabBarController?.popupBar.customBarViewController
also gives nil
hello, Thanks for your wonderful help in maintaining this library you are a real life saver. Here is my problem. I am trying to present a custom docking view in tab bar but it still shows a default docking view while presenting in the tab bar. the code I have used is below. I am trying to change the height of the docking view in real-time but it still shows space when the height is changed. and also i want to know is there any way to access the property of docking view from other view controller?
containingPopupBar.setNeedsLayout() containingPopupBar.layoutIfNeeded()
let customMapBar = UIStoryboard(name: "Custom", bundle: nil).instantiateViewController(withIdentifier: "CustomPopupBarViewController") as? CustomPopupBarViewController customMapBar?.view.backgroundColor = .clear // customMapBar.searchBar.delegate = self popupBar.customBarViewController = customMapBar! let popupContentController = UIStoryboard.songStoryboard.instantiateSongsPlayerViewController() popupContentView.popupCloseButtonStyle = .none popupInteractionStyle = .snap DispatchQueue.main.async { self.presentPopupBar(withContentViewController: popupContentController, animated: false, completion: nil) // self.tabBarController?.presentPopupBar(withContentViewController: popupContentController, animated: false, completion: nil) }
https://drive.google.com/file/d/1b7XchrcB8fUJDItGT-cqq_66o_qfD56R/view?usp=sharing I have uploaded google drive project please check. @LeoNatan Please check the build