Giter Site home page Giter Site logo

Comments (10)

HeathWang avatar HeathWang commented on May 14, 2024

建议使用框架的自动处理。

  • (BOOL)isAutoHandleKeyboardEnabled;
    设置距离inputView距离 offset
  • (CGFloat)keyboardOffsetFromInputView;

from hwpanmodal.

fuchenxi avatar fuchenxi commented on May 14, 2024

keyboardOffsetFromInputView 内部计算是不是有些问题。 我设置 -textFiled.height 才刚好在输入框底部

from hwpanmodal.

fuchenxi avatar fuchenxi commented on May 14, 2024
  1. 我如果想 viewWillAppear 就弹出键盘, 页面跑到窗口最底部
  2. 我点击backgroundView 收起页面时, 能否加个回调让我自己处理键盘的收起和其他一些事件

from hwpanmodal.

HeathWang avatar HeathWang commented on May 14, 2024

keyboardOffsetFromInputView 内部计算是不是有些问题。 我设置 -textFiled.height 才刚好在输入框底部

offset是根据找到的inputview来的,如果不对,提供一个demo到邮箱,我排查一下

from hwpanmodal.

HeathWang avatar HeathWang commented on May 14, 2024
  • 我如果想 viewWillAppear 就弹出键盘, 页面跑到窗口最底部
  • 我点击backgroundView 收起页面时, 能否加个回调让我自己处理键盘的收起和其他一些事件

/**

  • 通知回调即将dismiss
    */
  • (void)panModalWillDismiss;
    有回调的,试试在这个回调里处理。

from hwpanmodal.

fuchenxi avatar fuchenxi commented on May 14, 2024
  1. 我如果想 viewWillAppear 就弹出键盘, 页面跑到窗口最底部

目前处理是
-(void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [self.textField becomeFirstResponder]; }); }

from hwpanmodal.

HeathWang avatar HeathWang commented on May 14, 2024
  1. 我如果想 viewWillAppear 就弹出键盘, 页面跑到窗口最底部

目前处理是
-(void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [self.textField becomeFirstResponder]; }); }
viewWillAppear的时候动画还在执行当中,请在viewDidAppear试试
或者后面我增加一个回调,告诉你动画已完成。

from hwpanmodal.

fuchenxi avatar fuchenxi commented on May 14, 2024

放在viewDidAppear 键盘弹出就会有所停顿了。 类似于抖音发送评论页面

from hwpanmodal.

HeathWang avatar HeathWang commented on May 14, 2024

抖音的发送评论是一个单独的视图,没有嵌套到评论列表,我不知道你那边怎么做的?
你现在具体诉求是什么,把UIViewController+LayoutHelper.h暴露出来?

from hwpanmodal.

HeathWang avatar HeathWang commented on May 14, 2024

@fuchenxi
问题解决没?

from hwpanmodal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.