在UITableViewController上用self.view添加的子view视图被到tableview上了
.h文件
#import <UIKit/UIKit.h>
@interface tableViewController : UITableViewController
@end
.m文件
//viewDidLoad方法
- (void)viewDidLoad
{
[superviewDidLoad];
self.view.backgroundColor=[UIColorredColor];
UIView* view=[[UIViewalloc] initWithFrame:CGRectMake(20,20, 100,60)];
view.backgroundColor=[UIColorgrayColor];
[self.view addSubview:view];
// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
}
效果,下拉时也跟着下拉,所以当把tableVIew隐藏时,子视图也被隐藏了