I am new to iOS Programming, I have implemented UITableviewController
. I placed UIView
inside of UITableView
. I designed label, textfields and tableview inside of UIView
. Here My problem is, When I increasing the dynamic tableview based on array count, I want to increase my UIView
height also. I don't know how to do that?? Below is my design structure,
UITableViewController---
UIView----- (1)
Label---Label (2)
label---Label (3)
label--- (4)
UItableview (5)
textfield (6)
textfield (7)
and so on
below I have successfully increase the (5) height and also I want to increase (1) height I don't know how to do?? can any one suggest solution for this?? I have tried this below code.
-(void)viewDidLayoutSubviews{
CGFloat numberofrows=creditList.count;
height = numberofrows*propertytable.rowHeight;
_tableviewheight.constant = height;
propertytable.frame =CGRectMake(propertytable.frame.origin.x,propertytable.frame.origin.y, propertytable.frame.size.width,_tableviewheight.constant);
CGRect myviewframe=mainview.frame;
NSLog(@"The myviewframe value is %f",myviewframe.size.height);
mainview.translatesAutoresizingMaskIntoConstraints=YES;
myviewframe.size.height=5000;
mainview.frame=myviewframe;
mainview.frame = CGRectMake(0,0,mainview.frame.size.width, 5000);
mainview.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
mainview.contentMode = UIViewContentModeScaleAspectFit;
[mainview layoutIfNeeded];
}