From 94217b294ccd75a34787eb04d6e273e99536e45b Mon Sep 17 00:00:00 2001 From: 重庆迈尖科技有限公司 Date: 星期三, 30 一月 2019 15:12:32 +0800 Subject: [PATCH] no message --- BuWanVideo2.0/searchViewController.m | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/BuWanVideo2.0/searchViewController.m b/BuWanVideo2.0/searchViewController.m index 7b54b2d..e5e49da 100755 --- a/BuWanVideo2.0/searchViewController.m +++ b/BuWanVideo2.0/searchViewController.m @@ -78,7 +78,8 @@ [titleView addSubview:searchField]; self.navigationItem.titleView = titleView; [searchField.Field resignFirstResponder]; - searchField.Field.text = [YTHsharedManger startManger].searchTitle; + [searchField.Field setValue:[UIColor colorWithWhite:0.7 alpha:0.9] forKeyPath:@"_placeholderLabel.textColor"]; + searchField.Field.placeholder = [YTHsharedManger startManger].searchTitle; //瀹氬埗杩斿洖鎸夐挳 UIButton *backBtn=[[UIButton alloc] initWithFrame:CGRectMake(0, 0, 30, 50)]; [backBtn setTitle:@"杩斿洖" forState:UIControlStateNormal]; @@ -124,9 +125,12 @@ flow.scrollDirection = UICollectionViewScrollDirectionVertical; flow.minimumLineSpacing = 5;//鏈�灏忚闂磋窛(褰撳瀭鐩村竷灞�鏃舵槸琛岄棿璺濓紝褰撴按骞冲竷灞�鏃跺彲浠ョ悊瑙d负鍒楅棿璺�) flow.minimumInteritemSpacing = 10;//涓や釜鍗曞厓鏍间箣闂寸殑鏈�灏忛棿璺� - + CGFloat height = 64; + if (KIsiPhoneX) { + height = 84; + } //鍒涘缓CollectionView骞舵寚瀹氬竷灞�瀵硅薄 - _collectionView = [[UICollectionView alloc]initWithFrame:CGRectMake(0, kNavigationBarH, KScreenW,KScreenH-kNavigationBarH) collectionViewLayout:flow]; + _collectionView = [[UICollectionView alloc]initWithFrame:CGRectMake(0, height, KScreenW,KScreenH-height) collectionViewLayout:flow]; _collectionView.backgroundColor = kGlobalBackgroundColor; _collectionView.dataSource = self; _collectionView.delegate = self; @@ -160,6 +164,8 @@ -(void)search:(UIButton *)sender{ if (_searchField.Field.text.length>0) { [self searchCotol:_searchField.Field.text]; + }else if(_searchField.Field.placeholder.length > 0){ + [self searchCotol:_searchField.Field.placeholder]; } } @@ -279,6 +285,9 @@ //鍒锋柊鐑棬鎼滅储 [self.collectionView reloadSections:[NSIndexSet indexSetWithIndex:0]]; }else{ + if ([error compare:@"浼间箮宸叉柇寮�涓庝簰鑱旂綉鐨勮繛鎺ャ��"] == 0) { + [self autoDisappearAlertTime:1 msg:@"缃戠粶涓嶅彲鐢紝璇锋鏌ョ綉缁�"]; + } //鏄剧ず缃戠粶杩炴帴澶辫触 } }]; -- Gitblit v1.8.0