Ich möchte ADLivelyTableView verwenden, aber es konnte nicht gut funktionieren.ADLivelyTableView kann nicht verwendet werden
https://github.com/applidium/ADLivelyTableView
Hier ist mein Code.
◯ ViewController.h
#import "ADLivelyTableView.h"
@interface ViewController : GAITrackedViewController<UITableViewDelegate, UITableViewDataSource>
{
ADLivelyTableView * tableView;
}
@property (nonatomic, retain) ADLivelyTableView *tableView;
◯ ViewController.m
#import "ViewController.h"
#import "ADLivelyTableView.h"
@implementation ViewController
@synthesize tableView;
---- ---- Festcode
- (void)viewDidLoad {
tableView = [[ADLivelyTableView alloc]initWithFrame:rect style:UITableViewStylePlain];
//[transitionButton release];
tableView.delegate = self;
tableView.dataSource = self;
tableView = (ADLivelyTableView *)self.tableView;
tableView.initialCellTransformBlock = ADLivelyTransformFan;
[tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"Cell"];
NSString *cellIdentifier = @"Cell";
UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (!cell){// yes
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
}
[uv addSubview:tableView];
[tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"Cell"];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
// Return the number of rows in the section.
//return self.feedManager.feedArray.count;
return [[APP_DELEGATE titlearray] count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *cellIdentifier = @"Cell";
UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (!cell){// yes
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
}
// Update Cell
[self updateCell:cell atIndexPath:indexPath];
return cell;
}
- (void)updateCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath
{
// Update Cells
cell.backgroundColor = [UIColor clearColor];
cell.textLabel.text = [[APP_DELEGATE titlearray] objectAtIndex:indexPath.row];
cell.textLabel.textColor = [UIColor blackColor];
cell.textLabel.font = [UIFont fontWithName:@"HiraKakuProN-W3" size:15];
cell.textLabel.adjustsFontSizeToFitWidth = YES;
cell.textLabel.minimumScaleFactor = 10.0f;
cell.textLabel.numberOfLines = 0;
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
}
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle != UITableViewCellEditingStyleDelete) {
return;
}
[self.tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
[self.tableView reloadRowsAtIndexPaths:[self.tableView indexPathsForVisibleRows] withRowAnimation:UITableViewRowAnimationAutomatic];
}
und der Fehler von "Cast des Block-Zeigertyps" ADLivelyTransform "(aka" NSTimerInt ercal (^) CALayer * __ stark, float) ') bis C Zeigertyp 'const void *' erfordert eine Brücke cast“verursacht bei
if (block != _transformBlock) {
Block_release(transformBlock);
_transformBlock = Block_copy(block);
}
so dass ich diesen Code Kommentar aus und es gelang ihm aufzubauen.
Die Tabellenansichtszellen wurden jedoch nicht animiert.
was soll ich tun?
Thanks.The Fehler nicht erscheinen, aber die tableViewCell Animation hat nicht funktioniert ..... – bao
Sie sollten Tableview Delegatmethoden implementieren, was meinst du nicht funktioniert? – gabbler
Sind "tableView.delegate = self;" und "" nicht "TableView Delegate-Methoden"? Ich meine "nicht funktioniert" funktioniert nicht die Tableviewcell Animation, die von links erscheinen. –
bao