Coder Social home page Coder Social logo

Comments (8)

hhoangna avatar hhoangna commented on July 26, 2024 1

@hassan31 I just calculate and constraint.

Try this

private func setupLeftInputBarItem() {
        setLeftStackViewWidthConstant(to: 40, animated: false)
        middleContentViewPadding.left = -34
        btEmotion = makeButton(named: "ic_sticker_gray", onSelected: "ic_sticker_colored", size: CGSize(width: 40, height: 40))
        btEmotion.contentEdgeInsets = UIEdgeInsets(top: 6, left: 16, bottom: 10, right: 0)
        btEmotion.tag = 21
        setStackViewItems([btEmotion], forStack: .left , animated: false)
        
        invalidateIntrinsicContentSize()
    }

private func makeButton(named: String, onSelected nameSelect:String, size: CGSize) -> InputBarButtonItem {
        return InputBarButtonItem()
            .configure {
                $0.spacing = .fixed(10)
                $0.setSize(size, animated: false)
                $0.image = UIImage(named: named)?.withRenderingMode(.alwaysOriginal)
                $0.tintColor = UIColor(white: 0.8, alpha: 1)
            }.onSelected {
                $0.tintColor = .vinTextColor
                $0.image = UIImage(named: nameSelect)?.withRenderingMode(.alwaysOriginal)
            }.onTouchUpInside { item in
                //print("Item Tapped: \(item.tag)")
                if(item.tag == 21){
                    self.keyboardType = self.keyboardType == .emoji ? .text : .emoji
                    self.showKeyBoard(type: self.keyboardType, animated: true)
                }
            }
    }

from inputbaraccessoryview.

nathantannar4 avatar nathantannar4 commented on July 26, 2024

It looks like an error in your view controller transition. Your image preview controller is dismissed and then your messages controller becomes the first responder so the input bar appears. You should only dismiss the image preview controller when the drag gesture on the image ends

Sent with GitHawk

from inputbaraccessoryview.

hhoangna avatar hhoangna commented on July 26, 2024

How can I do like Messenger App? In Messenger, when I pan gesture on images, i still see input bar behind preview controller.

from inputbaraccessoryview.

nathantannar4 avatar nathantannar4 commented on July 26, 2024

Hmm, maybe try playing with the presentation style of the view controller to be .overCurrentContext?

Or, rather than presenting a new controller just add the image as a subview.

Sent with GitHawk

from inputbaraccessoryview.

hhoangna avatar hhoangna commented on July 26, 2024

Thanks a lot. I had found a solution. It is a trick :)

from inputbaraccessoryview.

nathantannar4 avatar nathantannar4 commented on July 26, 2024

@hhoangna what did you find worked for you?

Sent with GitHawk

from inputbaraccessoryview.

hassan31 avatar hassan31 commented on July 26, 2024

Hi, @hhoangna I just saw that you have added Emoji button inside the InputTextView, can you please let me know how can I add this to the InputBarView?

Thanks

from inputbaraccessoryview.

hassan31 avatar hassan31 commented on July 26, 2024

@hhoangna Awesome, thanks alot, it works. :)

from inputbaraccessoryview.

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.