TimeSharingViewController *con=[[[TimeSharingViewController alloc] init] autorelease];
con.view.backgroundColor=[UIColor clearColor];
con.view.frame=CGRectMake(8, 0, 304, 263);
con.stockNo=self.stockNo;
con.isDaPan=self.isDaPan;
con.view.autoresizesSubviews=YES;
[cell addSubview:con.view];
[self addChildViewController:con];
@implementation TimeSharingViewController
- (void)viewDidLoad {
SharingTimeView *sharingTimeView=[[SharingTimeView alloc] initWithFrame:CGRectMake(0, 0, 0.7*self.view.bounds.size.width, 0.5*self.view.bounds.size.height)];
sharingTimeView.autoresizingMask=UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
sharingTimeView.backgroundColor=[UIColor redColor];
sharingTimeView.tag=10101;
[self.view addSubview:sharingTimeView];
}
@end
sharingTimeView的frame.size.width是AutoresizingFlexibleWidth,效果是对的。但sharingTimeView的高度是错误的。为什么呢?