我使用IB和Auto Layout创建一个名为boundView
的视图,然后在控制器中调用[self.boundView layoutIfNeeded]
,然后我将self.boundView.frame.size
传递给一个方法来生成boundView&#39的大小; s子视图CardView
。然后使用
PlayingCardView *playingCardView = [[PlayingCardView alloc]initWithFrame:frame];
以编程方式创建子视图。我确实使用NSLog来检查子视图的大小是否小于superview。但是当我使用[self.boundView addSubview:CardView]
添加子视图时。它比superview大!
坐标有问题吗?或者是因为我将自动布局与我按代码创建的视图结合起来了?
答案 0 :(得分:1)
val read_file2 = sc.textFile("/home/hari/sample_data_exp/extract_column_only.csv")
read_file2.collect()
val tmp1 = read_file2.map { line => val parts = line.split(',')
parts.drop(3).take(1)
中,那么自动布局大小尚未计算。尝试在viewDidLoad
中完成。