0
我想刪除for循環fron滾動視圖中動態分配的子視圖。 m代碼難以釋懷的是:如何從滾動視圖中刪除動態分配的子視圖
for (int i=0; i<[appDelegate.NO_KPI count]; i++) {
static float j = 0;
roc_temp = [[UIView alloc]init];
roc_temp.frame = CGRectMake(81, 57 + j, 193, 119);
label1 = [[UILabel alloc] init];
label1.frame =CGRectMake(0, 0, 193, 26);
label1.text = @"Budget";
[roc_temp addsubview:label1];
[scrollview addSubview:roc_temp];
roc_temp1 = [[UIView alloc]init];
roc_temp1.frame = CGRectMake(318, 57 + j, 193, 119);
label11 = [[UILabel alloc] init];
label11.frame =CGRectMake(0, 0, 193, 26);
label11.text = @"Actual";
[roc_temp1 addsubview:label11];
[scrollview addSubview:roc_temp1];
j+=166;
}
非常感謝您的幫助和響應遺憾後來 – rehan
沒問題。你總是可以upvote和/或接受:) – 2012-01-30 10:41:16