2016-11-20 4 views
0

私の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; 

} 

ここでは何も

Description

+0

あなたのテーブルビューではユーザー対話が有効になっていますか? – KAR

+0

私はそれを自分のコードに追加しましたが、まだ動作していません –

+0

ビュー階層に他のスクロールビューがありますか?ビュー階層も共有してください。 – Adeel

答えて

0
それに重なっていないので、エッジのいずれかの近くにテーブルビューありえないことを示すために私のビューコントローラの絵だ私のビューコントローラ内のコードです

//このコードを削除する

-(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]; 
} 
} 
+0

そのコードを削除する、クリアする – Vinodh

0

私はあなたにテーブルビューのスクロールの完全な答えを提供します

関連する問題