优化松诺在小屏设备上的滑动
This commit is contained in:
parent
85cebc7912
commit
9462b3f3bb
|
|
@ -26,9 +26,10 @@
|
||||||
#import "SongNuo86Name.h"
|
#import "SongNuo86Name.h"
|
||||||
#import "UserExtendataArchaver.h"
|
#import "UserExtendataArchaver.h"
|
||||||
|
|
||||||
@interface SongNuoDBCenterViewController ()
|
@interface SongNuoDBCenterViewController ()<UITableViewDelegate>
|
||||||
{
|
{
|
||||||
dispatch_queue_t _songNuoMainQueue;
|
dispatch_queue_t _songNuoMainQueue;
|
||||||
|
CGFloat _tableviewSizeHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
@property(nonatomic,strong) SongNuoDBSetViewController *songNuoSetVC;
|
@property(nonatomic,strong) SongNuoDBSetViewController *songNuoSetVC;
|
||||||
|
|
@ -59,6 +60,24 @@
|
||||||
UITapGestureRecognizer*tapgestureRecognizer=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(songNuoBDSetBtnAction:)];
|
UITapGestureRecognizer*tapgestureRecognizer=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(songNuoBDSetBtnAction:)];
|
||||||
[self.setImag addGestureRecognizer:tapgestureRecognizer];
|
[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- 设置
|
#pragma mark- 设置
|
||||||
|
|
||||||
|
|
@ -248,8 +267,10 @@
|
||||||
self.nuoJiaReBtn = self.button;
|
self.nuoJiaReBtn = self.button;
|
||||||
self.jiaReName = textLbl;
|
self.jiaReName = textLbl;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
_tableviewSizeHeight = 64 + CGRectGetMaxY(textLbl.frame);
|
||||||
|
|
||||||
|
}
|
||||||
[self initCHNames];
|
[self initCHNames];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue