// 打字与印刷结构体的艺术

骑马,马跑起来很帅,滑沙,水翼船,保障,理财

增多键盘弹起和收取的监听


1.监听键盘的关照

– (void)viewWillAppear:(BOOL)animated {

    [super viewWillAppear:animated];

    [[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyBoardDidShow:) name:UIKeyboardDidShowNotification
object:nil];

    [[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyBoardDidHide:) name:UIKeyboardDidHideNotification
object:nil];

}

– (void)viewWillDisappear:(BOOL)animated{

    [super viewWillDisappear:animated];

    [[NSNotificationCenter defaultCenter] removeObserver:self
name:UIKeyboardDidShowNotification object:nil];

    [[NSNotificationCenter defaultCenter] removeObserver:self
name:UIKeyboardDidHideNotification object:nil];

}


push崩溃,先hidden再dismiss

2.textfiled的代理方法,获取点击的是十分view

– (BOOL)textFieldShouldBeginEditing:(UITextField *)textField {

    self.tmpView = (InputView *)textField.superview;

    return YES;

}

血的训诫,UITextView 不要用addsubview方法

三.键盘弹出的法子

– (void)keyBoardDidShow:(NSNotification *)notification {

    CGRect rect = [[[notification userInfo]
objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];

// 打字与印刷结构体的点子

//    NSLog(@”%@”, NSStringFromCGRect(rect));

    CGFloat kbHeight = rect.size.height;

    CGFloat offset = (_tmpView.frame.origin.y +
_tmpView.frame.size.height + 40 + _backScrollView.frame.origin.y) –
(self.view.frame.size.height – kbHeight);

    double duration = [[notification.userInfo
objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue];

    if(offset > 0) {

        [UIView animateWithDuration:duration animations:^{

            self.view.frame = CGRectMake(0.0f, -offset,
self.view.frame.size.width, self.view.frame.size.height);

        }];

    }

}

http://www.jianshu.com/p/1c453fa3be88

4.键盘回收的主意

– (void)keyBoardDidHide:(NSNotification *)notif {

    double duration = [[notif.userInfo
objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue];

    [UIView animateWithDuration:duration animations:^{

        self.view.frame = CGRectMake(0, 0, self.view.frame.size.width,
self.view.frame.size.height);

    }];

}

报错音信:

***** Assertion failure in -[UITextView layoutSublayersOfLayer:],
/SourceCache/UIKit/UIKit-2935.138/UIView.m:8794**

 

[self.signContentView addSubview:self.placeholderlab];

 

self.signContentView是贰个UITextView,self.placeholderlab是1个lab,是为了仿效UITextField的placeholder写的,最后只得把self.placeholderlab加载在父视图下边,壹切都ok了,然而我只怕无法分晓为何会崩溃。

 

文/yunis(简书小编)

原作链接:http://www.jianshu.com/p/1c453fa3be88

文章权归作者全部,转发请联系我获得授权,并标明“简书小编”。


 

5.23

停诊详细情况页,发表时上面有剩余的文字,–>除了惊人设置为0,同时将文案设置为空字符串就行了

 

5.24

微调view布局

调节台约束报错,用mas_updateConstraints 替换mas_make

 

5.25

深谙团队成员,业务范围

进医生黄页,再点急迅电话,重回重返导航条没了,

 

刘艳杰改好了

 

临时要求,改文案,不懂跟产品调换,及时沟通, 结果后来要潜伏的地点不做了,多联系,不然做无用功了

 

在意细心,调节bug数量


依照字符串长度判别string.length
不要用nil决断


if ([district hasSuffix:@”区”]) {  // 去掉末尾文字

            district=[district substringToIndex:district.length-1];

        }

 


dealloc里面去掉女华

-(void)dealloc

{

    [SVProgressHUD dismiss];

}

-(void)viewWillDisappear:(BOOL)animated

{

    [super viewWillDisappear:animated];

    [SVProgressHUD dismiss];

}


#pragma mark – 重新布局,更新frame

修改frame

-(void)viewDidLayoutSubviews{

    [super viewDidLayoutSubviews];


拉动画的 筛选view

图片 1

 

图片 2

 

图片 3

 


展示简单介绍里面能够加扩大名


linker command failed with exit code 1 (use -v to see invocation)

 

//const CGFloat kLine_Hight = 24.0f;

//const CGFloat kLine_Top = 12.0f;

//const CGFloat kBtn_Font = 15.0f;

const常量名字重新了