优化松诺在小屏设备上的滑动
This commit is contained in:
parent
85cebc7912
commit
9462b3f3bb
|
|
@ -26,9 +26,10 @@
|
|||
#import "SongNuo86Name.h"
|
||||
#import "UserExtendataArchaver.h"
|
||||
|
||||
@interface SongNuoDBCenterViewController ()
|
||||
@interface SongNuoDBCenterViewController ()<UITableViewDelegate>
|
||||
{
|
||||
dispatch_queue_t _songNuoMainQueue;
|
||||
CGFloat _tableviewSizeHeight;
|
||||
}
|
||||
|
||||
@property(nonatomic,strong) SongNuoDBSetViewController *songNuoSetVC;
|
||||
|
|
@ -58,8 +59,26 @@
|
|||
[self.setbackBtn addTarget:self action:@selector(songNuoBDSetBtnAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
UITapGestureRecognizer*tapgestureRecognizer=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(songNuoBDSetBtnAction:)];
|
||||
[self.setImag addGestureRecognizer:tapgestureRecognizer];
|
||||
|
||||
[self.tableView addObserver:self forKeyPath:@"contentSize" options:NSKeyValueObservingOptionNew context:nil];
|
||||
|
||||
}
|
||||
|
||||
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context {
|
||||
if ([keyPath isEqualToString:@"contentSize"]) {
|
||||
NSValue *new = [change valueForKey:NSKeyValueChangeNewKey];
|
||||
CGSize size = [new CGSizeValue];
|
||||
if (size.height == 0) {
|
||||
self.tableView.contentSize = CGSizeMake(size.width, _tableviewSizeHeight);
|
||||
}
|
||||
} else {
|
||||
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[self.tableView removeObserver:self forKeyPath:@"contentSize"];
|
||||
}
|
||||
#pragma mark- 设置
|
||||
|
||||
-(void)songNuoBDSetBtnAction{
|
||||
|
|
@ -248,8 +267,10 @@
|
|||
self.nuoJiaReBtn = self.button;
|
||||
self.jiaReName = textLbl;
|
||||
}
|
||||
|
||||
_tableviewSizeHeight = 64 + CGRectGetMaxY(textLbl.frame);
|
||||
|
||||
}
|
||||
|
||||
[self initCHNames];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue