// // GXFBaseSearchViewController.m // XFFruit // // Created by freecui on 15/9/1. // Copyright (c) 2015年 Xummer. All rights reserved. // #define BACKGROUND_CLOLOR HexColor(@"f8f8f8"); #import "GXFBaseSearchViewController.h" @interface GXFBaseSearchViewController () @end @implementation GXFBaseSearchViewController - (instancetype)initWithSubViews { self = [super init]; if (!self) { return nil; } UIBarButtonItem *rightItem = [[UIBarButtonItem alloc]initWithTitle:@"确定" style:UIBarButtonItemStylePlain target:self action:@selector(sureClick)]; self.navigationItem.rightBarButtonItem = rightItem; self.f_textFiled = [[UITextField alloc]initWithFrame:CGRectMake(20, 5, self.view.width - 20 * 2, TopMargin - 10)]; self.f_textFiled.textAlignment = NSTextAlignmentLeft; self.f_textFiled.background = [UIImage imageNamed:@"textFiled"]; self.f_textFiled.font = FontSize(15); [self.view addSubview:_f_textFiled]; UIImageView *leftImgV = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 35, 40)]; leftImgV.image = [UIImage imageNamed:@"search"]; self.f_textFiled.leftView = leftImgV; self.f_textFiled.leftViewMode = UITextFieldViewModeAlways; UIButton *rightBtn = [UIButton buttonWithType:UIButtonTypeCustom]; [rightBtn setImage:[UIImage imageNamed:@"delete"] forState:UIControlStateNormal]; rightBtn.frame = CGRectMake(0, 0, 35, 40); [rightBtn addTarget:self action:@selector(deleteClicked) forControlEvents:UIControlEventTouchUpInside]; self.f_textFiled.rightView = rightBtn; self.f_textFiled.rightViewMode = UITextFieldViewModeAlways; self.view.backgroundColor = BACKGROUND_CLOLOR; // self.f_tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, TopMargin, self.view.width, self.view.height - TopMargin - NavigationBarHeight) style:UITableViewStylePlain]; // [self.view addSubview:_f_tableView]; return self; } - (void)sureClick { if ([_delegate respondsToSelector:@selector(baseSearchViewControllernClickedNavigationRightButton)]) { [_delegate baseSearchViewControllernClickedNavigationRightButton]; } } - (void)deleteClicked { if ([_delegate respondsToSelector:@selector(baseSearchViewControllerClickedDelegateButton)]) { [_delegate baseSearchViewControllernClickedNavigationRightButton]; } } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } /* #pragma mark - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { // Get the new view controller using [segue destinationViewController]. // Pass the selected object to the new view controller. } */ @end