2015-08-08 134 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