mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-06 22:33:10 +00:00
Fix feedback compose view in landscape and iOS 8
In landscape the text couldn't be seen, since the text view was moved up due to iOS 8 returning the keyboard height now as `height` in landscape, while it did return it as `width` in previous iOS versions.
This commit is contained in:
parent
6874e00fbc
commit
34f78ebbef
@ -146,18 +146,22 @@
|
|||||||
|
|
||||||
CGRect frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
|
CGRect frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
|
||||||
if (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPad) {
|
if (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPad) {
|
||||||
if (UIInterfaceOrientationIsPortrait(self.interfaceOrientation))
|
if (!bit_isPreiOS8Environment() || UIInterfaceOrientationIsPortrait(self.interfaceOrientation)) {
|
||||||
frame.size.height -= kbSize.height;
|
frame.size.height -= kbSize.height;
|
||||||
else
|
} else {
|
||||||
frame.size.height -= kbSize.width;
|
frame.size.height -= kbSize.width;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
CGSize windowSize = [[UIScreen mainScreen] bounds].size;
|
CGSize windowSize = [[UIScreen mainScreen] bounds].size;
|
||||||
CGFloat windowHeight = windowSize.height - 20;
|
CGFloat windowHeight = windowSize.height - 20;
|
||||||
CGFloat navBarHeight = self.navigationController.navigationBar.frame.size.height;
|
CGFloat navBarHeight = self.navigationController.navigationBar.frame.size.height;
|
||||||
|
|
||||||
if (UIInterfaceOrientationIsPortrait(self.interfaceOrientation)) {
|
if (!bit_isPreiOS8Environment() || UIInterfaceOrientationIsPortrait(self.interfaceOrientation)) {
|
||||||
CGFloat modalGap = (windowHeight - self.view.bounds.size.height) / 2;
|
CGFloat modalGap = (windowHeight - self.view.bounds.size.height) / 2;
|
||||||
frame.size.height = windowHeight - navBarHeight - modalGap - kbSize.height;
|
frame.size.height = windowHeight - navBarHeight - kbSize.height;
|
||||||
|
if (bit_isPreiOS8Environment()) {
|
||||||
|
frame.size.height -= modalGap;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
windowHeight = windowSize.width - 20;
|
windowHeight = windowSize.width - 20;
|
||||||
CGFloat modalGap = 0.0f;
|
CGFloat modalGap = 0.0f;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user