瀏覽代碼

首页搜索条

huangxiaodong 9 月之前
父節點
當前提交
bdfbfe52ed

+ 6 - 0
创维盒子/code/Assets.xcassets/search/Contents.json

@@ -0,0 +1,6 @@
+{
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 22 - 0
创维盒子/code/Assets.xcassets/search/home_search_icon.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "home_search_icon@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "home_search_icon@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

二進制
创维盒子/code/Assets.xcassets/search/home_search_icon.imageset/home_search_icon@2x.png


二進制
创维盒子/code/Assets.xcassets/search/home_search_icon.imageset/home_search_icon@3x.png


+ 16 - 2
创维盒子/code/NAS/NASViewController.m

@@ -42,6 +42,7 @@
 #import "imageVersionUpdateFailView.h"
 #import "queryHeartbeatModel.h"
 #import "BoxHeartbeatAlertTool.h"
+#import "searchBarView.h"
 
 @interface NASViewController ()<UITableViewDelegate,UITableViewDataSource>
 {
@@ -62,6 +63,7 @@
 @property (nonatomic,strong)UITableView*tableView;
 
 @property (nonatomic, strong) UIView*tableHeadView;
+@property (nonatomic, strong) searchBarView* searchBarV;
 @property (nonatomic, strong) NASMySpaceView* NASMySpaceV;
 @property (nonatomic, strong) NASCommonUsedView* NASCommonUsedV;
 
@@ -217,11 +219,22 @@
     
     self.tableView.userInteractionEnabled = NO;
     
-    _tableHeadView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, 165+ 15 +120 +54 + 15)];
+    _tableHeadView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, (42+ 14) + 165+ 15 +120 +54 + 15)];
     //_tableHeadView.backgroundColor = [UIColor hwColor:@"#F6F8FA"];
     _tableHeadView.backgroundColor = [UIColor clearColor];
     self.tableView.tableHeaderView = _tableHeadView;
     
+    //1.4.5 新加搜索 (高度 42+14)
+    _searchBarV = [[searchBarView alloc] init];
+    [_tableHeadView addSubview:_searchBarV];
+    
+    [_searchBarV mas_makeConstraints:^(MASConstraintMaker *make) {
+        //make.top.equalTo(welcomeImageV.mas_bottom).offset(20);
+        make.top.mas_equalTo(0);
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.height.mas_equalTo(42);
+    }];
     
     //我的空间
     _NASMySpaceV = [[NASMySpaceView alloc] init];
@@ -229,7 +242,8 @@
     
     [_NASMySpaceV mas_makeConstraints:^(MASConstraintMaker *make) {
         //make.top.equalTo(welcomeImageV.mas_bottom).offset(20);
-        make.top.mas_equalTo(0);
+        make.top.equalTo(_searchBarV.mas_bottom).offset(14);
+        //make.top.mas_equalTo(0);
         make.left.mas_equalTo(0);
         make.right.mas_equalTo(0);
         make.height.mas_equalTo(165);

+ 16 - 0
创维盒子/code/NAS/search/searchBarView.h

@@ -0,0 +1,16 @@
+//
+//  searchBarView.h
+//  隐私保护
+//
+//  Created by xd h on 2025/3/4.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface searchBarView : UIView
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 81 - 0
创维盒子/code/NAS/search/searchBarView.m

@@ -0,0 +1,81 @@
+//
+//  searchBarView.m
+//  隐私保护
+//
+//  Created by xd h on 2025/3/4.
+//
+
+#import "searchBarView.h"
+
+@implementation searchBarView
+
+- (id)initWithFrame:(CGRect)frame{
+    self = [super initWithFrame:frame];
+    
+    //self.backgroundColor = [UIColor clearColor];
+    [self drawAnyView];
+    
+    return self;
+}
+
+-(void)drawAnyView
+{
+    UIView *whiteBgView = [[UIView alloc] init];
+    whiteBgView.backgroundColor = [UIColor whiteColor];
+    [self addSubview:whiteBgView];
+    whiteBgView.layer.cornerRadius = 12;
+    whiteBgView.layer.masksToBounds = YES;
+    
+    [whiteBgView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.mas_equalTo(0);
+        make.left.mas_equalTo(16);
+        make.right.mas_equalTo(-16);
+        make.bottom.mas_equalTo(0);
+    }];
+    
+    //搜索小图标
+    UIImageView *imageView = [[UIImageView alloc] init];
+    imageView.image = [UIImage imageNamed:@"home_search_icon"];
+    [whiteBgView addSubview:imageView];
+    
+    [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.width.mas_equalTo(24);
+        make.height.mas_equalTo(24);
+        make.left.mas_equalTo(9);
+        make.centerY.mas_equalTo(0);
+    }];
+    
+    //左边搜索文字
+    UILabel *SearchLabel = [[UILabel alloc] init];
+    NSString *titleStr = NSLocalizedString(@"Search_nas_title",nil);
+    SearchLabel.text = titleStr;
+    SearchLabel.font = [UIFont systemFontOfSize:12];
+    SearchLabel.textColor = [UIColor hwColor:@"#7C8196" alpha:1.0];
+    [whiteBgView addSubview:SearchLabel];
+    
+    [SearchLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.height.mas_equalTo(24);
+        make.left.equalTo(imageView.mas_right).offset(2);
+        make.centerY.mas_equalTo(0);
+    }];
+    
+    //右边搜索按钮
+    UIButton *searchBut = [[UIButton alloc] init];
+    [searchBut setTitle:titleStr forState:UIControlStateNormal];
+    [searchBut setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
+    searchBut.titleLabel.font = [UIFont systemFontOfSize:12.0];
+    searchBut.backgroundColor = [UIColor hwColor:@"#01B7EA" alpha:1.0];
+    searchBut.layer.cornerRadius = 10;
+    searchBut.userInteractionEnabled = NO;
+    [whiteBgView addSubview:searchBut];
+    
+    [searchBut mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.height.mas_equalTo(32);
+        make.width.mas_equalTo(48);
+        make.right.mas_equalTo(-10);
+        make.centerY.mas_equalTo(0);
+    }];
+    
+}
+
+@end

+ 3 - 0
创维盒子/code/zh-Hans.lproj/Localizable.strings

@@ -661,3 +661,6 @@
 "Heartbeat_box_restarting_phone" = "云手机重启中...";
 "Heartbeat_box_restarting_phone_tip" = "云手机重启预计需要90秒,请稍后重试。";
 "Heartbeat_box_restart_Suc_phone" = "云手机重启成功";
+
+//1.4.5
+"Search_nas_title"      = "搜索";

+ 20 - 0
创维盒子/双子星云手机.xcodeproj/project.pbxproj

@@ -617,6 +617,10 @@
 		6B5D86802C22EA5B008D25EA /* lastFileManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5D867D2C22EA5B008D25EA /* lastFileManager.h */; };
 		6B5D86812C22EA5B008D25EA /* lastFileManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5D867D2C22EA5B008D25EA /* lastFileManager.h */; };
 		6B5D86822C22EA5B008D25EA /* lastFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B5D867E2C22EA5B008D25EA /* lastFileManager.m */; };
+		6B5ECC932D76FB5D0069CB86 /* searchBarView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5ECC912D76FB5D0069CB86 /* searchBarView.h */; };
+		6B5ECC942D76FB5D0069CB86 /* searchBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B5ECC922D76FB5D0069CB86 /* searchBarView.m */; };
+		6B5ECC952D76FB5D0069CB86 /* searchBarView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5ECC912D76FB5D0069CB86 /* searchBarView.h */; };
+		6B5ECC962D76FB5D0069CB86 /* searchBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B5ECC922D76FB5D0069CB86 /* searchBarView.m */; };
 		6B63179C2BFD8CA000FF4FB4 /* videoPlayByAVPlayerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B63179B2BFD8CA000FF4FB4 /* videoPlayByAVPlayerViewController.m */; };
 		6B63179D2BFD8CA000FF4FB4 /* videoPlayByAVPlayerViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B63179A2BFD8CA000FF4FB4 /* videoPlayByAVPlayerViewController.h */; };
 		6B63179E2BFD8CA000FF4FB4 /* videoPlayByAVPlayerViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B63179A2BFD8CA000FF4FB4 /* videoPlayByAVPlayerViewController.h */; };
@@ -1949,6 +1953,8 @@
 		6B5D86782C22D6E9008D25EA /* NASLastFileView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NASLastFileView.m; sourceTree = "<group>"; };
 		6B5D867D2C22EA5B008D25EA /* lastFileManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = lastFileManager.h; sourceTree = "<group>"; };
 		6B5D867E2C22EA5B008D25EA /* lastFileManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = lastFileManager.m; sourceTree = "<group>"; };
+		6B5ECC912D76FB5D0069CB86 /* searchBarView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = searchBarView.h; sourceTree = "<group>"; };
+		6B5ECC922D76FB5D0069CB86 /* searchBarView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = searchBarView.m; sourceTree = "<group>"; };
 		6B63179A2BFD8CA000FF4FB4 /* videoPlayByAVPlayerViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = videoPlayByAVPlayerViewController.h; sourceTree = "<group>"; };
 		6B63179B2BFD8CA000FF4FB4 /* videoPlayByAVPlayerViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = videoPlayByAVPlayerViewController.m; sourceTree = "<group>"; };
 		6B6317A02BFD9DB500FF4FB4 /* ZFCustomControlView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZFCustomControlView.h; sourceTree = "<group>"; };
@@ -3312,6 +3318,7 @@
 		6B5D86632C227C4A008D25EA /* NAS */ = {
 			isa = PBXGroup;
 			children = (
+				6B5ECC902D76FADD0069CB86 /* search */,
 				6BDB85B42D572FDC00526D1F /* BoxHeartbeatAlertTool */,
 				6BF62B122D55D57700E7A98A /* model */,
 				6BB573312C8076A600713351 /* nasBackupsManager */,
@@ -3356,6 +3363,15 @@
 			path = view;
 			sourceTree = "<group>";
 		};
+		6B5ECC902D76FADD0069CB86 /* search */ = {
+			isa = PBXGroup;
+			children = (
+				6B5ECC912D76FB5D0069CB86 /* searchBarView.h */,
+				6B5ECC922D76FB5D0069CB86 /* searchBarView.m */,
+			);
+			path = search;
+			sourceTree = "<group>";
+		};
 		6B679DF42C25593800D0DC03 /* mine */ = {
 			isa = PBXGroup;
 			children = (
@@ -4288,6 +4304,7 @@
 				6B0581602AFCD0DF00D37290 /* uploadImageOrVideoViewController.h in Headers */,
 				18F9CB092ABD7835003FF71A /* TipsQRCodeForChangeDeviceViewController.h in Headers */,
 				6B07AC2B2BF8D38F005C2B0E /* NASFileAudioModel.h in Headers */,
+				6B5ECC932D76FB5D0069CB86 /* searchBarView.h in Headers */,
 				6B2C1E522C070ADE00FDCF82 /* ZFVolumeBrightnessView.h in Headers */,
 				6BF62B1A2D55D9E400E7A98A /* queryHeartbeatModel.h in Headers */,
 				6B5B60722B3D8098009A2AE2 /* fileTransferPathCheckTableViewCell.h in Headers */,
@@ -4587,6 +4604,7 @@
 				6BD506F62B9576A4006E7CB0 /* uploadImageOrVideoViewController.h in Headers */,
 				6BD506F72B9576A4006E7CB0 /* TipsQRCodeForChangeDeviceViewController.h in Headers */,
 				6B07AC2E2BF8D38F005C2B0E /* NASFileAudioModel.h in Headers */,
+				6B5ECC952D76FB5D0069CB86 /* searchBarView.h in Headers */,
 				6B2C1E532C070ADE00FDCF82 /* ZFVolumeBrightnessView.h in Headers */,
 				6BF62B192D55D9E400E7A98A /* queryHeartbeatModel.h in Headers */,
 				6BD506F82B9576A4006E7CB0 /* fileTransferPathCheckTableViewCell.h in Headers */,
@@ -5160,6 +5178,7 @@
 				6BD507942B9576A4006E7CB0 /* downloadFileRecordCell.m in Sources */,
 				6BD507952B9576A4006E7CB0 /* UIProgressView+AFNetworking.m in Sources */,
 				6B2C1E772C070ADE00FDCF82 /* ZFLandscapeViewController.m in Sources */,
+				6B5ECC962D76FB5D0069CB86 /* searchBarView.m in Sources */,
 				6B3E7A8C2C8A9FFB00B032C4 /* pingManager.m in Sources */,
 				6B2C1E5B2C070ADE00FDCF82 /* UIViewController+ZFPlayerRotation.m in Sources */,
 				6BD507962B9576A4006E7CB0 /* HWAddFolderViewController.m in Sources */,
@@ -5541,6 +5560,7 @@
 				6BED888F2B4E901900F76DDC /* downloadFileRecordCell.m in Sources */,
 				183AE64C2A8A2CF000B11CB0 /* UIProgressView+AFNetworking.m in Sources */,
 				6B2C1E762C070ADE00FDCF82 /* ZFLandscapeViewController.m in Sources */,
+				6B5ECC942D76FB5D0069CB86 /* searchBarView.m in Sources */,
 				6B3E7A8A2C8A9FFA00B032C4 /* pingManager.m in Sources */,
 				6B2C1E5A2C070ADE00FDCF82 /* UIViewController+ZFPlayerRotation.m in Sources */,
 				A031DD7527EC507000909527 /* HWAddFolderViewController.m in Sources */,