2014-02-23 56 views
0

我有一個以編程方式創建的tableView,並且滾動不起作用。選擇工作正常,但沒有滾動。有什麼建議麼? 我下面的代碼:以編程方式創建TableView時不滾動

.M

[dialogView addSubview:dialogTableView]; 

CGRect dialogTableViewFrame = CGRectMake(10, 150, 260, 300); 
dialogTableView = [[UITableView alloc] initWithFrame:dialogTableViewFrame style: UITableViewStylePlain]; 

dialogTableView.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth; 
dialogTableView.scrollEnabled = YES; 
dialogTableView.delegate = self; 
dialogTableView.dataSource = self; 

[dialogTableView reloadData]; 

[dialogView addSubview:dialogTableView]; 

.H

@interface MapsViewController : UIViewController <GMSMapViewDelegate,UITableViewDataSource, UITableViewDelegate> { 

UIView *dialogView; 
UITableView *dialogTableView; 
UIScrollView *dialogScrollView; 



} 

@property (nonatomic, retain) UIView *dialogView; 
@property (nonatomic, retain) UITableView *dialogTableView; 
@property (nonatomic, retain) UIScrollView *dialogScrollView; 
@property (nonatomic, retain) NSArray *people; 
+0

'[dialogTableView contentSize]'的結果是什麼? –

+0

內容大小:260.000000 x 0.000000(!!!!?) – Oswaldo

+0

嘗試刪除autoresizingMask我不確定是否需要此處。 –

回答

0

嘗試的tableView的反彈屬性設置爲YES

dialogTableView.bounces = YES; 
dialogTableView.alwaysBounceVertical = YES; 

根據經驗,如果這些設置爲NO,它可以防止tableView滾動。

+0

感謝您的幫助,但它沒有奏效!滾動仍然凍結:(桌面選擇工作正常。 – Oswaldo

相關問題