0
我正在使用UITableview,我希望單元格看起來像按下的按鈕,我該怎麼做?UITableView,單擊,模仿按鈕按下
我正在使用UITableview,我希望單元格看起來像按下的按鈕,我該怎麼做?UITableView,單擊,模仿按鈕按下
點擊後,您可以嘗試更改UITableViewCell
的背景視圖。您可以使用此方法獲取單擊的單元格。
UITableViewCell *cell=[tableView cellForRowAtIndexPath:indexPath];
試試這個,
//獲得選擇的tableview細胞和細胞進行一些動畫。我正在使用縮放向上和向下動畫
#pragma mark Table View Delgate method
- (void)tableView:(UITableView *)tbView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
CustomTableViewCellForTradeList *cell=(CustomTableViewCellForTradeList *)[tbl_TradeList cellForRowAtIndexPath:indexPath ];
cell.transform = CGAffineTransformMakeScale(0.85,0.85);
[self performSelector:@selector(NavigateToTradeBuySellAfterScaling:) withObject:indexPath afterDelay:0.1];
}
// rescale uitableview cell。
-(void)NavigateToTradeBuySellAfterScaling:(NSIndexPath *)indexPath
{
CustomTableViewCellForTradeList *cell=(CustomTableViewCellForTradeList *)[tbl_TradeList cellForRowAtIndexPath:indexPath ];
cell.transform = CGAffineTransformMakeScale(1.0,1.0);
[self performSelector:@selector(NavigateToTradeBuySellAfterScaling1:) withObject:indexPath afterDelay:0.1];
}
//導航到其他視圖控制器
-(void)NavigateToTradeBuySellAfterScaling1:(NSIndexPath *)indexPath
{
TradeBuySellViewController* tradeBuySellController = [[TradeBuySellViewController alloc] initWithNibName:@"TradeBuySellViewController" bundle:nil :entity];
[self.navigationController pushViewController:tradeBuySellController animated:YES];
}
創建自定義的UITableView細胞和使用任何控制想它。 – Suryakant