2015-08-08 175 views
1

我可以使用「添加按鈕」進行推送轉換,但我也需要以編程方式進行。當我以編程的方式執行操作時,然後回到'添加按鈕'變成灰色。我調試了它,我可以看到_titleView中_defualtAttributes已經改變。顏色值已更改。它爲什麼會改變?如何防止它?它看起來很混亂。導航按鈕在轉換後將顏色更改爲灰色

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    AddPalletViewController * addPalletViewController = [self addPalletViewControllerInstance]; 
    [addPalletViewController setEditMode:true]; 
    [addPalletViewController setEditModeRowValue: [[self.datasource objectAtIndex: indexPath.section] objectAtIndex: [[[self.sectionArray objectAtIndex:indexPath.section] objectAtIndex:indexPath.row+1]intValue]]]; 
    [[self navigationController] pushViewController: addPalletViewController animated:YES]; 
} 
+0

請分享一些代碼,使畫面變得清晰! – dip

回答

0

把這個代碼,而不是你的..

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
AddPalletViewController * addPalletViewController = [self addPalletViewControllerInstance]; 
[addPalletViewController setEditMode:true]; 
[addPalletViewController setEditModeRowValue: [[self.datasource objectAtIndex: indexPath.section] objectAtIndex: [[[self.sectionArray objectAtIndex:indexPath.section] objectAtIndex:indexPath.row+1]intValue]]]; 
[[self navigationController] pushViewController: addPalletViewController animated:YES]; 
//Will deselect your row... 
[tableView deselectRowAtIndexPath:indexPath animated:YES]; 
} 
+0

沒有什麼改變...現在在ViewDidAppear我改變了按鈕的顏色。 – bodziuandrzej