//
|
// ConfirmTheGoodsViewController.m
|
// BuWanVideo2.0
|
//
|
// Created by apple on 17/1/6.
|
// Copyright © 2017年 com.yeshi.buwansheque.ios. All rights reserved.
|
//
|
|
#import "ConfirmTheGoodsViewController.h"
|
|
@interface ConfirmTheGoodsViewController ()
|
|
@end
|
|
@implementation ConfirmTheGoodsViewController
|
|
- (void)viewDidLoad {
|
[super viewDidLoad];
|
//返回按钮
|
UIButton *backButton=[UIButton buttonWithType:UIButtonTypeRoundedRect];
|
backButton.frame=CGRectMake(0, 0, 50, 44);
|
[backButton setTitle:@"<返回" forState:UIControlStateNormal];
|
[backButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
backButton.titleLabel.font = [UIFont systemFontOfSize:17.0];
|
[backButton addTarget:self action:@selector(BackClick:) forControlEvents:UIControlEventTouchUpInside];
|
UIBarButtonItem *backBtnItem=[[UIBarButtonItem alloc] initWithCustomView:backButton];
|
self.navigationItem.leftBarButtonItem=backBtnItem;
|
|
//标题
|
UILabel *TLabel=[[UILabel alloc] initWithFrame:CGRectMake(0, 0, 50, 44)];
|
TLabel.text=@"发布";
|
TLabel.textColor=[UIColor whiteColor];
|
TLabel.font=[UIFont systemFontOfSize:18];
|
self.navigationItem.titleView=TLabel;
|
|
//增加通知中心监听,当键盘出现或消失时收出消息
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWasShown:) name:UIKeyboardWillShowNotification object:nil];
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
|
|
_imageH.constant=(KScreenW-16)/15*14;
|
}
|
|
-(void)BackClick:(UIButton *)sender{
|
[self.navigationController popViewControllerAnimated:NO];
|
}
|
|
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
|
[_textView resignFirstResponder];
|
}
|
|
#pragma mark 键盘隐藏
|
-(void)keyboardWillHide:(NSNotification *)notification{
|
_imageH.constant=(KScreenW-16)/15*14;
|
_KeyBoradH.constant=0;
|
}
|
|
#pragma mark 键盘出现
|
-(void)keyboardWasShown:(NSNotification *)notification{
|
NSDictionary* info = [notification userInfo];
|
CGSize kbSize = [[info objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue].size;//得到键盘的高度
|
|
_imageH.constant=(KScreenW-16)/15*14-kbSize.height;
|
_KeyBoradH.constant=kbSize.height;
|
}
|
|
- (void)didReceiveMemoryWarning {
|
[super didReceiveMemoryWarning];
|
// Dispose of any resources that can be recreated.
|
}
|
|
@end
|