Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Update the height of the extension view after being set #20

Open
koenbud opened this issue Aug 5, 2014 · 6 comments
Open

Update the height of the extension view after being set #20

koenbud opened this issue Aug 5, 2014 · 6 comments

Comments

@koenbud
Copy link
Contributor

koenbud commented Aug 5, 2014

When I change the height of the extension view after calling setExtensionView, the contractionAmount and expandCenter of extensionController remain unchanged.

What should I do after updating the extension view frame height?

@koenbud koenbud changed the title Change frame height of extensionview after settings Change frame height of extension view after using setExtensionView Aug 5, 2014
@Mazyod
Copy link
Contributor

Mazyod commented Aug 5, 2014

@koenbud try to reassign the extension view, so the container can be updated.

@koenbud
Copy link
Contributor Author

koenbud commented Aug 5, 2014

@Mazyod Thanks for the quick reply. What do you mean by reassigning extension view?

Using setExtensionView again doesn't work because of condition condition: view != _extensionView

@Mazyod
Copy link
Contributor

Mazyod commented Aug 5, 2014

@koenbud Ah, I forgot that I changed that.. Thanks for reporting.

I just did some quick research, and I think a good approach is to swizzle the layoutSubviews of UIView from the library side to solve the problem for all users... Or better yet, I might create a UIViewController subclass and assign its view to the library's extension view container. This way, the view controller should get all the view notifications, including viewWillLayoutSubviews.

Hopefully the fix will be rolled out before tomorrow.

@Mazyod Mazyod added bug and removed question labels Aug 5, 2014
@koenbud
Copy link
Contributor Author

koenbud commented Aug 5, 2014

@Mazyod Alright sounds good!

Mazyod added a commit that referenced this issue Aug 5, 2014
@Mazyod
Copy link
Contributor

Mazyod commented Aug 5, 2014

@koenbud Unfortunately, after implementing the view controller idea, there was a weird view glitch happening, so I moved to the manual approach, which is exposing -[self layoutViews]. You can check out that branch if you are in a hurry, but I want to try one more thing before giving up, so hopefully there won't be any need to make this call in the future.

@skela
Copy link
Contributor

skela commented Mar 4, 2015

I had the same problem, but I just took the same approach as you would a table view header, i.e. you remove it then re-add it, worked fine for me:

[self.shyNavBarManager setExtensionView:nil];

Change header height....

[self.shyNavBarManager setExtensionView:header];

@Mazyod Mazyod changed the title Change frame height of extension view after using setExtensionView Update the height of the extension view after being set Nov 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants