私のView Controller内にUITableViewがあり、データがテーブルにロードされますが、スクロールできません。私はそれを修正する多くの方法を試したが、解決策を見つけることができません。私はまた、サイドバーメニューのSWRevealViewControllerを使用しているが、私はそれがスクロール機能に影響するとは思わない?はスクロールできませんUITableView - 客観的なC xCode 7.3
ここ
- (void)viewDidLoad {
[super viewDidLoad];
SWRevealViewController *revealViewController = self.revealViewController;
if (revealViewController)
{
[self.barButton setTarget: self.revealViewController];
[self.barButton setAction: @selector(revealToggle:)];
[self.view addGestureRecognizer:self.revealViewController.panGestureRecognizer];
}
_providerName = [NSMutableArray arrayWithObjects:
@"Food Bank of Alaska",
@"Community Food Bank of Central Alabama",
@"Food Bank of North Alabama",
@"Montgomery Area Food Bank",
@"Feeding the Gulf Coast",
@"Northwest Arkansas Food Bank",
@"River Valley Regional Food Bank",
@"Food Bank of Northeast Arkansas",
@"Arkansas Foodbank",
@"Harvest Texarkana Regional Food Bank",
@"United Food Bank",
@"St. Mary's Food Bank Alliance",
... (there's more data here)
nil];
_providerId = [NSMutableArray arrayWithObjects:@"0", @"0", @"0",
@"0", @"0", @"0",
@"0", @"0", @"0",
..... (there's more data here)
nil];
self.navigationItem.title = @"Call History";
}
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
[self.tableView reloadData];
}
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
// Remove seperator inset
if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
[cell setSeparatorInset:UIEdgeInsetsZero];
}
// Prevent the cell from inheriting the Table View's margin settings
if ([cell respondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)]) {
[cell setPreservesSuperviewLayoutMargins:NO];
}
// Explictly set your cell's layout margins
if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
[cell setLayoutMargins:UIEdgeInsetsZero];
}
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [self.providerName count];
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"moneyItemRow";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
cell.textLabel.text = [self.providerName objectAtIndex:indexPath.row];
cell.detailTextLabel.text =[self.providerId objectAtIndex:indexPath.row];
return cell;
}
ここでは何も
あなたのテーブルビューではユーザー対話が有効になっていますか? – KAR
私はそれを自分のコードに追加しましたが、まだ動作していません –
ビュー階層に他のスクロールビューがありますか?ビュー階層も共有してください。 – Adeel