i have been developing a custom keyboard with extensions. i would like to change the height of the keyboard when the device rotates. Currently am not using sizes classes just the autolayout constraints. Thanks in advance
Asked
Active
Viewed 72 times
0
-
Have you given the Hight constraints to your keyboard view? – Jaimish Dec 17 '15 at 05:23
-
yes i have tried to add height constraints to the inputView but its not working. could you please let me know when to change the constraint's constant. i mean in which call back? – Sandhil Eldhose Dec 17 '15 at 05:25
-
do you know how to change the Constraints height programmatically? – Jaimish Dec 17 '15 at 05:30
-
yes i know to change the constraints height programaticaly – Sandhil Eldhose Dec 17 '15 at 05:35
1 Answers
0
When you rotate your device for example portrait to landscape right and Landscap right to portrait.
-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
if (fromInterfaceOrientation == UIInterfaceOrientationLandscapeRight)
{
// change you height constraints here when landscap;
}
else if (fromInterfaceOrientation == UIInterfaceOrientationMaskPortrait)
{
// change you height constraints here when portrait;
}
}

Jaimish
- 629
- 5
- 15