Skip to content

Switch to using topLayoutGuide to determine vertical offset#208

Open
jlorich wants to merge 2 commits into
KrauseFx:masterfrom
jlorich:fix_in_call_status_position
Open

Switch to using topLayoutGuide to determine vertical offset#208
jlorich wants to merge 2 commits into
KrauseFx:masterfrom
jlorich:fix_in_call_status_position

Conversation

@jlorich

@jlorich jlorich commented Mar 2, 2015

Copy link
Copy Markdown

Fixes: #130 .

The status bar height changes based on in-call or navigation status, however if the ViewController has an autoResizingMaskof UIViewAutoresizingFlexibleTopMargin the ViewControllers view will already be adjusted for the increased status bar size. If a TSMessage is displayed when this is the case, it will show 24px below the navigation bar as the view is automatically adjusted for the statusBar height change, and then the TSMessageView is additionally moved down based on the new status bar size.

To fix this issue, I've changed the display position to use the viewControllers [topLayoutGuide length] as the vertical offset, as it already takes into account navigation bar and status bar size correctly. Adjustments have also been made for when the viewController is a UINavigationController subclass, since it's view is handled a bit differently.

@jlorich jlorich changed the title Switch to using topLayoutGuid to determine vertical offset Switch to using topLayoutGuide to determine vertical offset Mar 2, 2015
Comment thread Pod/Classes/TSMessage.m

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this works, it doesn't adapt when the top layout guide changes (such as if the user changes the orientation of their device).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TSMessageView position when calling status bar is on screen

2 participants