|
|
@@ -13,7 +13,7 @@
|
|
|
//#import "backupsFileManager.h"
|
|
|
#import "nasBackupsManager.h"
|
|
|
|
|
|
-@interface fileTransfeSetViewController ()<UITableViewDelegate,UITableViewDataSource>
|
|
|
+@interface fileTransfeSetViewController ()<UITableViewDelegate,UITableViewDataSource,UITextViewDelegate>
|
|
|
@property (nonatomic, strong) UITableView *tableView;
|
|
|
@property (nonatomic, strong) UIView *tailView;
|
|
|
@property (nonatomic, strong) UILabel *uploadFilePathLabel;
|
|
|
@@ -642,38 +642,89 @@
|
|
|
|
|
|
- (UIView*)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
|
|
|
|
|
|
- UIView *tailView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, 5+10+20)];
|
|
|
- if(section==2){
|
|
|
- tailView.frame = CGRectMake(0, 0, SCREEN_W, 5+10+30);
|
|
|
- }
|
|
|
-
|
|
|
- UILabel *lab = [[UILabel alloc] init];
|
|
|
- lab.font = [UIFont systemFontOfSize:12.0];
|
|
|
- lab.textColor = [UIColor hwColor:@"666666" alpha:1.0];
|
|
|
- lab.numberOfLines = 0;
|
|
|
- //lab.backgroundColor = [UIColor redColor];
|
|
|
- [tailView addSubview:lab];
|
|
|
-
|
|
|
- CGFloat height = 20.0;
|
|
|
+ UIView *tailView = [[UIView alloc] init];
|
|
|
+// if(section==2){
|
|
|
+// tailView.frame = CGRectMake(0, 0, SCREEN_W, 5+10+30);
|
|
|
+// }
|
|
|
|
|
|
if(section==0){
|
|
|
+ tailView.frame = CGRectMake(0, 0, SCREEN_W, 5+10+20);
|
|
|
+ UILabel *lab = [[UILabel alloc] init];
|
|
|
+ lab.font = [UIFont systemFontOfSize:12.0];
|
|
|
+ lab.textColor = [UIColor hwColor:@"666666" alpha:1.0];
|
|
|
+ lab.numberOfLines = 0;
|
|
|
+ //lab.backgroundColor = [UIColor redColor];
|
|
|
+ [tailView addSubview:lab];
|
|
|
+ CGFloat height = 20.0;
|
|
|
+
|
|
|
[lab setText:NSLocalizedString(@"File_Transfer_By_Cellular_tip2",nil)];
|
|
|
+
|
|
|
+ [lab mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.mas_equalTo(15);
|
|
|
+ make.right.mas_equalTo(-15);
|
|
|
+ //make.bottom.mas_equalTo(-10);
|
|
|
+ make.height.mas_equalTo(height);
|
|
|
+ make.top.mas_equalTo(5);
|
|
|
+ }];
|
|
|
}
|
|
|
else if(section==1){
|
|
|
- height = 40.0;
|
|
|
- [lab setText:NSLocalizedString(@"File_Transfer_background_working_tip_2",nil)];
|
|
|
- }
|
|
|
- else if(section==2){
|
|
|
- [lab setText:NSLocalizedString(@"File_Transfer_full_speed_tip",nil)];
|
|
|
+ tailView.frame = CGRectMake(0, 0, SCREEN_W, 5+10+40.0);
|
|
|
+
|
|
|
+ UITextView *contentTV = [[UITextView alloc] init];
|
|
|
+ contentTV.backgroundColor = [UIColor clearColor];
|
|
|
+ // contentTV.textColor = [UIColor hwColor:@"#666666"];
|
|
|
+ contentTV.font = [UIFont systemFontOfSize:12.0];
|
|
|
+ // contentTV.textAlignment = NSTextAlignmentCenter;
|
|
|
+ contentTV.delegate = self;
|
|
|
+ contentTV.editable = NO; //必须禁止输入,否则点击将弹出输入键盘
|
|
|
+ contentTV.scrollEnabled = NO;
|
|
|
+ [tailView addSubview:contentTV];
|
|
|
+
|
|
|
+ [contentTV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.mas_equalTo(15);
|
|
|
+ make.right.mas_equalTo(-15);
|
|
|
+ make.bottom.mas_equalTo(0);
|
|
|
+ make.top.mas_equalTo(5);
|
|
|
+ }];
|
|
|
+
|
|
|
+ // 创建长按手势识别器
|
|
|
+ UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPress)];
|
|
|
+ // 设置长按手势的最小按压时间
|
|
|
+ longPress.minimumPressDuration = 0.5; // 2
|
|
|
+ // 将手势识别器添加到视图上
|
|
|
+ [contentTV addGestureRecognizer:longPress];
|
|
|
+
|
|
|
+ NSString *title1 = NSLocalizedString(@"File_Transfer_background_working_tip_2",nil);
|
|
|
+ NSString *title2 = @"";//NSLocalizedString(@"go_setting_title",nil);
|
|
|
+
|
|
|
+
|
|
|
+ NSString *fullTitle = [[NSString alloc] initWithFormat:@"%@ %@",title1,title2];
|
|
|
+
|
|
|
+ NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:fullTitle];
|
|
|
+
|
|
|
+ UIColor *noteColor = [UIColor hwColor:@"#6A6A6A" alpha:1.0];
|
|
|
+ NSRange leftRange = NSMakeRange([fullTitle rangeOfString:title1].location, [fullTitle rangeOfString:title1].length);
|
|
|
+ [attrStr addAttribute:NSForegroundColorAttributeName value:noteColor range:leftRange];
|
|
|
+
|
|
|
+// UIColor *rightColor = [UIColor hwColor:@"#01B7EA" alpha:0.8];
|
|
|
+// NSRange rightRange = NSMakeRange([fullTitle rangeOfString:title2].location, [fullTitle rangeOfString:title2].length);
|
|
|
+
|
|
|
+// [attrStr addAttribute:NSLinkAttributeName
|
|
|
+// value:@"didclick1://"
|
|
|
+// range:rightRange];
|
|
|
+
|
|
|
+ // [attrStr addAttribute:NSForegroundColorAttributeName value:rightColor range:rightRange];
|
|
|
+
|
|
|
+
|
|
|
+ // 设置段落样式以实现水平中间对齐
|
|
|
+// NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
|
|
|
+// paragraphStyle.alignment = NSTextAlignmentLeft; // 水平中间对齐
|
|
|
+// [attrStr addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, attrStr.length)];
|
|
|
+
|
|
|
+
|
|
|
+ contentTV.attributedText = attrStr;
|
|
|
}
|
|
|
|
|
|
- [lab mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.left.mas_equalTo(15);
|
|
|
- make.right.mas_equalTo(-15);
|
|
|
- //make.bottom.mas_equalTo(-10);
|
|
|
- make.height.mas_equalTo(height);
|
|
|
- make.top.mas_equalTo(5);
|
|
|
- }];
|
|
|
|
|
|
return tailView;
|
|
|
}
|
|
|
@@ -726,4 +777,36 @@
|
|
|
// }
|
|
|
}
|
|
|
|
|
|
+#pragma mark ---- textView Delegate ----
|
|
|
+- (BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)URL inRange:(NSRange)characterRange interaction:(UITextItemInteraction)interaction
|
|
|
+{
|
|
|
+
|
|
|
+ if([[URL scheme] isEqualToString:@"didclick1"]){
|
|
|
+ [self gotoSettingFun];
|
|
|
+ return NO;
|
|
|
+ }
|
|
|
+
|
|
|
+ return YES;
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+#pragma mark 拦截长按事件
|
|
|
+- (void)longPress{
|
|
|
+ HLog(@"拦截长按事件")
|
|
|
+}
|
|
|
+
|
|
|
+#pragma mark 跳转设置界面
|
|
|
+- (void)gotoSettingFun
|
|
|
+{
|
|
|
+ // 打开应用的设置页面(不适用于全局设置如低电量模式)
|
|
|
+ NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
|
|
|
+ //NSURL *url = [NSURL URLWithString:@"Prefs:root=BATTERY_USAGE"];
|
|
|
+// NSURL *url = [NSURL URLWithString:@"Prefs:root=General"];
|
|
|
+// [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
|
|
|
+ if ([[UIApplication sharedApplication] canOpenURL:url]) {
|
|
|
+ [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
|
|
|
+ } else {
|
|
|
+ HLog(@"无法打开系统设置");
|
|
|
+ }
|
|
|
+}
|
|
|
@end
|