In your widget UIViewController.m
(Objective-C):
self.preferredContentSize = CGSizeMake(0, 200);
Will make your widget have a height of 200.
Note that the width will have no affect on the view, as widgets must fit in the exact width of notification center, which is handled automagically.
Also, if you want to animate changes in the height of your view, you can implement (Objective-C):
- (void)viewWillTransitionToSize:(CGSize)size
withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
in your view controller using -animateAlongsideTransition:completion:
The answer was a bit hidden; you had to click around in the documentation sidebar to eventually find this fantastic document.
Another way is to use auto-layout constraints to constrain your view's height.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…