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

Doesn't work correctly with "initWithCustomView:" on UIBarButtonItem in UIToolbar #7

Open
benguild opened this issue Oct 11, 2019 · 5 comments
Labels
bug Something isn't working

Comments

@benguild
Copy link

Tried this out, and found that this didn't size correctly in this configuration. It squished whatever is on either side, and the buttons weren't visible.

@TimOliver
Copy link
Owner

G'day Ben! :D

Oh no. I might have screwed up one of the initialisers if the buttons weren't appearing.
I just pushed a fix to master. See if it's still happening for you. :)

@TimOliver TimOliver added the bug Something isn't working label Oct 22, 2019
@benguild
Copy link
Author

The buttons were appearing but they were massive. Normally within a UIBarButtonItem they'd be the minimum size but here they were taking up the whole bar.

@TimOliver
Copy link
Owner

TimOliver commented Oct 24, 2019

Uhhhh. Hmm. That might be implicit behavior of the UIBarButtonItem when it's dealing with what it thinks is a vanilla UIView. I'm not sure if there's a way I can intelligently block that from within the codebase.

You sure you can't just resize the frame manually and use flexible width items on either side? :D

@benguild
Copy link
Author

So to clarify, if I put UISegmentedControl (a view, heh) in instead it works and looks fine, but this takes up the entire bar's width and squishes all of the other items to nothing.

@TimOliver
Copy link
Owner

Sounds fine to me. 🙃

Yeah, I don't know. Maybe there's a layout property in UIKit where you can set the preferred content size of a view. I'd need to play with it, but I've got other iOS 13 fires to put out at the moment. 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants