你好,歡迎來到IOS教程網

 Ios教程網 >> IOS編程開發 >> IOS開發綜合 >> iOS 中tableview的headerView高度變化是掩蓋cell的問題

iOS 中tableview的headerView高度變化是掩蓋cell的問題

編輯:IOS開發綜合

點擊展開按鈕時haderview的高度發作了改動,,headerview是自定義的View,但是全體規劃並沒有改動,招致cell被掩蓋。最後經過發送告訴傳值額辦法處理了,代碼如下:

再點擊按鈕的時分收回告訴,把自定義View的高度傳出

NSString *heigt = [NSString stringWithFormat:@"%f",self.height];


NSMutableDictionary *dict = [[NSMutableDictionary alloc]init];
[dict setValue:heigt forKey:@"headViewHeight"];

[[NSNotificationCenter defaultCenter]postNotificationName:@"spread" object:nil userInfo:dict];


在高度改動的頁面接納偏重新賦值

[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(spread:) name:@"spread" object:nil];

}
-(void)spread:(NSNotification*)notice{
NSString *heigt = notice.userInfo[@"headViewHeight"];
self.headView.height = heigt.integerValue;
self.tableView.tableHeaderView = self.headView;

}


在下小白一枚,缺乏之處請多多指教

【iOS 中tableview的headerView高度變化是掩蓋cell的問題】的相關資料介紹到這裡,希望對您有所幫助! 提示:不會對讀者因本文所帶來的任何損失負責。如果您支持就請把本站添加至收藏夾哦!

  1. 上一頁:
  2. 下一頁:
蘋果刷機越獄教程| IOS教程問題解答| IOS技巧綜合| IOS7技巧| IOS8教程
Copyright © Ios教程網 All Rights Reserved