My UIViewController
contains a UITableView
(is always on top, the same width with the superview), and a UITextView
(is always under the UITableView
10.0f), as below:
Now I want to use autolayout to raise up the UITextView
when the keyboard appears. I add the following constraints for UITableView
(sticks to the top, and is always on top of UITextView
10.0f):
UITableView
: Width (320), Height (706), Left, Right, Top, Bottom (10.0f)UITextView
: Width (280), Height (44), Left, Right
I assign IBOutlet
the UITableView's
height constraint, and modify its value in code. For example, when the keyboard appears, the height of UITableView
will be decreased -216.0f (the height of the keyboard), and as a result, the UITextView
will be raised up on top of the keyboard (because the UITextView
is always under the UITableView
10.0f).
So, that's what I expected. However, for the only first step, when running application, the UITableView
takes up the whole screen, and I do not see my UITextView
. Is there any problem with my constraints?