CRToast icon indicating copy to clipboard operation
CRToast copied to clipboard

Height does not reflect NavBar height when it has a prompt

Open onato opened this issue 11 years ago • 4 comments

If you set self.navigationItem.prompt the navigation bar increases in height. This is not taken into account by CRToast.

ios simulator screen shot 1 07 2014 10 16 23 pm

I guess this problem is also seen when rotating. See https://github.com/cruffenach/CRToast/pull/73#issuecomment-46438193

onato avatar Jul 01 '14 20:07 onato

Damn, good one.

cruffenach avatar Jul 02 '14 00:07 cruffenach

The code has avoided looking for a UINavigationBar in the hierarchy, but I think this kind of issue will require it.

Ashton-W avatar Jul 07 '14 10:07 Ashton-W

Perhaps you can use a controllers topLayoutGuide instead?

onato avatar Jul 08 '14 13:07 onato

@Ashton-W I created a branch that is able to account for this & updated the demo project with an option to add the prompt.

This does have to look in the hierarchy for a UINavigationController so this may not be the most ideal solution. Also I'm not sure if my solution will work in every instance of a prompt existing. It does seem to work for both portrait & landscape.

https://github.com/dmiedema/CRToast/tree/Navigation-Bar-Prompt

dmiedema avatar Nov 11 '14 18:11 dmiedema