我在我的項目中添加了一個UIScrollView ...我添加了10個按鈕「fieldButton」一次,然後我想添加其他5個按鈕的同一個UIScrollView。它試圖做到這一點第一次添加10按鈕也進入scrollview ..如何刪除第一個添加10按鈕之前添加其他項目。在相同的滾動視圖...刪除按鈕形式滾動視圖
if(a == 1){
for(int i = 0; i< 10; i++){
UIButton *fieldButton_area = [[Mos_component alloc]getComboButton:title andFrame:CGRectMake(0, y, 180, 40)];
[fieldButton_area addSubview:cid];
[fieldButton_area addTarget:self action:@selector(get_Area:) forControlEvents:UIControlEventTouchUpInside];
[state_scroll addSubview:fieldButton_area];
}
}
else{
UIButton *fieldButton_state = [[Mos_component alloc]getComboButton:title andFrame:CGRectMake(0, y, 180, 40)];
[fieldButton_state addSubview:cid];
[fieldButton_state addTarget:self action:@selector(get_Area:) forControlEvents:UIControlEventTouchUpInside];
[state_scroll addSubview:fieldButton_state];
}
非常感謝....幫助.... – jaleel 2010-01-06 11:32:51
它不能正常工作 – jaleel 2010-01-06 13:59:47
究竟是什麼錯? – Vladimir 2010-01-06 14:27:14