在我的iPhone應用程序中,我有一個UITableView。 我想兩個按鈕,而它的刷卡上一個細胞出現,我想他們是這樣的:刷卡後UITableViewCell上的自定義按鈕
的按鈕將是我自己的自定義按鈕
的按鈕會出現一個像蘋果提供的普通刪除按鈕一樣的小動畫。
有沒有辦法做到這一點?
感謝
在我的iPhone應用程序中,我有一個UITableView。 我想兩個按鈕,而它的刷卡上一個細胞出現,我想他們是這樣的:刷卡後UITableViewCell上的自定義按鈕
的按鈕將是我自己的自定義按鈕
的按鈕會出現一個像蘋果提供的普通刪除按鈕一樣的小動畫。
有沒有辦法做到這一點?
感謝
我認爲boilerplate.com是全力幫助你的問題,它包含不同類型的電池技術。與按鈕刷卡也包括http://iosboilerplate.com/
我做
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
UISwipeGestureRecognizer *swipeLeftRight = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleGesture:)];
[swipeLeftRight setDirection:(UISwipeGestureRecognizerDirectionRight | UISwipeGestureRecognizerDirectionLeft)];
[cell addGestureRecognizer:swipeLeftRight];
-(void)handleGesture : (UIGestureRecognizer *)gec
{
if (gec.state == UIGestureRecognizerStateEnded) {
UITableViewCell *cell = (UITableViewCell *)gec.view;
UIImageView *imgDelete = [[UIImageView alloc]initWithFrame:CGRectMake(cell.frame.size.width-40, 15, 35, 35)];
UITapGestureRecognizer *deleteCell = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(deleteC)];
[imgDelete addGestureRecognizer:deleteCell];
imgDelete.image = [UIImage imageNamed:@"delete.png"];
imgDelete.userInteractionEnabled = YES;
[cell bringSubviewToFront:imgDelete];
[UIView animateWithDuration:0.5
animations:^(void){
[cell addSubview:imgDelete];
}completion:nil];}
}
你做多遠到現在?郵編。 – Emon 2012-01-18 07:20:24
您需要閱讀指導原則。這可能會導致應用拒絕,因爲您違反了標準。 – iamsult 2012-01-17 10:38:48
你能否說出一定的觀點會違反? – vikingosegundo 2012-01-17 10:41:48