| | |
| | | @property (weak, nonatomic) UITableView *suggestTableview;//模糊搜索弹出的表格 |
| | | @property (nonatomic , strong) NSMutableArray *suggestSearch;//搜索建议 |
| | | @property (weak, nonatomic) IBOutlet UISegmentedControl *segment;//分段按钮 |
| | | @property (weak, nonatomic) IBOutlet NSLayoutConstraint *topConstraint; |
| | | |
| | | @property (nonatomic , strong) UITableView *DisplayTabelView;//用于显示搜索结果的列表 |
| | | @end |
| | |
| | | */ |
| | | -(void)addSegment{ |
| | | self.segment.tintColor = kGlobalYellowColor; |
| | | if (KIsiPhoneX) { |
| | | self.topConstraint.constant = 94; |
| | | } |
| | | [self.segment setTitleTextAttributes:@{NSForegroundColorAttributeName:KGlobalLightGreyColor_153} forState:UIControlStateNormal]; |
| | | [self.segment setTitleTextAttributes:@{NSForegroundColorAttributeName:kGlobalMainColor} forState:UIControlStateSelected]; |
| | | [self.segment addTarget:self action:@selector(segmentClick:) forControlEvents:UIControlEventValueChanged]; |
| | |
| | | */ |
| | | -(void)addTabelView{ |
| | | if(self.DisplayTabelView==nil){ |
| | | self.DisplayTabelView=[[UITableView alloc] initWithFrame:CGRectMake(0, kNavigationBarH+40, KScreenW, KScreenH-kNavigationBarH-40) style:UITableViewStylePlain]; |
| | | CGFloat height = 64; |
| | | if (KIsiPhoneX) { |
| | | height = 94; |
| | | } |
| | | |
| | | self.DisplayTabelView=[[UITableView alloc] initWithFrame:CGRectMake(0, height+40, KScreenW, KScreenH-height-40) style:UITableViewStylePlain]; |
| | | } |
| | | self.DisplayTabelView.delegate=self; |
| | | self.DisplayTabelView.dataSource=self; |
| | |
| | | [self.DisplayTabelView.mj_footer endRefreshing]; |
| | | [self.DisplayTabelView reloadData]; |
| | | }else{ |
| | | [SVProgressHUD showWithStatus:error]; |
| | | //提示用户失败 |
| | | [self.DisplayTabelView.mj_header endRefreshing]; |
| | | [self.DisplayTabelView.mj_footer endRefreshing]; |