Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/96.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 更改自定义UIView中UITableView的高度_Ios_Objective C_Uitableview_Uiview - Fatal编程技术网

Ios 更改自定义UIView中UITableView的高度

Ios 更改自定义UIView中UITableView的高度,ios,objective-c,uitableview,uiview,Ios,Objective C,Uitableview,Uiview,我有一个tableview,它位于自定义类UIView中。然后将此自定义UIView添加到另一个UIViewController中如果我更改了xib文件中表格视图的高度,则它会在应用程序运行时进行相应的更改。我正在尝试通过编程方式更改此表格视图的高度,尽管这取决于它有多少单元格 通常我会做一个tableview.frame=CGRectMake(15,29290,height),这会改变大小,但似乎不起作用 我还尝试了[tableView setFrame:CGRectMake(15,29290

我有一个tableview,它位于自定义类UIView中。然后将此自定义UIView添加到另一个UIViewController中<代码>如果我更改了xib文件中表格视图的高度,则它会在应用程序运行时进行相应的更改。我正在尝试通过编程方式更改此表格视图的高度,尽管这取决于它有多少单元格

通常我会做一个
tableview.frame=CGRectMake(15,29290,height)
,这会改变大小,但似乎不起作用

我还尝试了
[tableView setFrame:CGRectMake(15,29290,height)]这也不起作用。我在设置自定义视图的自定义uiview中的方法中尝试了它,也在添加视图的UIViewController中尝试了它。以下是我在UIViewController中添加自定义uiview的代码

    LeagueInvites* invitedView =[[[NSBundle mainBundle] loadNibNamed:@"InvitedView"
                                                               owner:nil
                                                             options:nil] objectAtIndex:0];
    [invitedView setUpLeagueInvite:allInvites :obj.nUserName];
    invitedView.frame=CGRectMake(0, (615 +height), 320, 29+([allInvites count]*120));
    [invitedView.tableView setFrame:CGRectMake(0, 29, 290, 400)];
    [self.fullScroll addSubview:invitedView];

非常感谢您的帮助。

您确定表视图所在的容器视图有足够的高度容纳表视图的新高度吗?@rocky是的,当我手动将表视图在其工作的视图中放大时,它只是以编程方式在设置框架后似乎没有响应,查询帧,它是否与您设置的匹配?帧与我以编程方式输入的匹配,但这并不反映屏幕上实际发生的情况。上面说视图是240,但应用程序上的实际视图只有120hmmmm。你检查了该视图上的自动布局设置了吗?