Closed ryderjack closed 8 years ago
What version of the lib are you using?
Latest via Coacopods
I have this same issue
I'm also experiencing the same issue.
Hi Mates, How did you fix this issue ?
Nobody ?
I got rid of the search bar and used insets to move the collection view up
You know, you can always look at the implementation and try to fix it and submit a PR. That's the whole point of open source: collaboration.
I know, I am trying but I don´t realize how to fix it. The problem is only when you have a one search option and the scope tabs don´t appear. Ryderjack can you give any detail please ?
@dzenbot Do you have any idea? I could try to fix it if you help me.
My first though is that the main view controller uses a few static height values. For example: https://github.com/dzenbot/DZNPhotoPickerController/blob/master/Source/Classes/Core/DZNPhotoDisplayViewController.m#L147
Perhaps, these values should be dynamic instead.
@dzenbot Hi ! Thanks for your answer. I don´t think the problem is layoutFittingSize function because the shifting occurs after the SearchBar loses the focus and this function is not executed at this point. My thought is that something changes in iOS 8 with the navigationbar but I have been trying all the afternoon and I can´t fix it yet.
Does this happen on iOS 9?
@dzenbot Yes, I am in iOS 9 trying the search with only Flicker. Try it in your example, put only one image provider.
Why would you mention iOS 8 then? Please, give it a try. Debug. We're all developers. If this is a huge concern on your product, spend the time to do the tweak.
@dzenbot I am debugging it, in case I can fix it I will submit the fix but my problem now is that i´m lost. I appreciate your work. In case you realize what is happening please let me know. Thanks man ! :)
Ok, I just found the solution. The problem of the shifting is when you set only one search provider (ie: Flicker). The cause of it is that in the method - (UISearchController *)searchController of DZNPhotoDisplayViewController.m, the scopeButtonTitles is set with an array of only one element and the framework has to deal with it and it doesn´t know how. The scope buttons must be set with an array of more than one element. So the solution is:
if([[self segmentedControlTitles] count]>1)
{
searchBar.scopeButtonTitles = [self segmentedControlTitles];
}
else
{
searchBar.scopeButtonTitles = nil;
}
I hope it works for you and you fix the code in order to avoid this error in the future.
That solution makes a lot of sense. Would you be so kind to submit a Pull Request with the fix?
@dzenbot There is only a branch, I don´t know how to do the pull request.
@dzenbot I just put up a pull request #114. And double checked it in my app. Thanks @jarrillaga
After every search the search bar in the picker controller moves down, see image:
Running on iOS 9.3, installed via CocoaPods