Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EmojiView showing as thin line within UIInputViewController #83

Open
RL-William-Coates opened this issue Aug 13, 2024 · 0 comments
Open

Comments

@RL-William-Coates
Copy link

I am writing a keyboard extension, and I'm trying to add the EmojiView as a subview of a UIInputViewController, but it's showing as a thin line down the left-hand side. I've tried alerting the frame and constraints, but can't get the EmojiView to cover the width of the device. Here's a screenshot:

SCR-20240813-oiwm

I get a warning about being unable to satisfy contraints:

Unable to simultaneously satisfy constraints.
	Probably at least one of the constraints in the following list is one you don't want. 
	Try this: 
		(1) look at each constraint and try to figure out which you don't expect; 
		(2) find the code that added the unwanted constraint or constraints and fix it. 
(
    "<NSLayoutConstraint:0x600002137f20 H:[UICollectionView:0x102062a00]-(0)-|   (active, names: '|':Keyboard_1.CategoriesBottomView:0x101d13a80 )>",
    "<NSLayoutConstraint:0x600002135f90 H:[UIButton:0x101d4cd80]-(11)-|   (active, names: '|':Keyboard_1.CategoriesBottomView:0x101d13a80 )>",
    "<NSLayoutConstraint:0x6000021368f0 H:[UICollectionView:0x102062a00]-(0)-[UIButton:0x101d4cd80]   (active)>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x6000021368f0 H:[UICollectionView:0x102062a00]-(0)-[UIButton:0x101d4cd80]   (active)>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.

Example code:

class KeyboardViewController: UIInputViewController {
    override func viewDidLoad() {
        let keyboardSettings = KeyboardSettings(bottomType: .categories)
        var emojisKeyboard = EmojiView(keyboardSettings: keyboardSettings)
        emojisKeyboard.translatesAutoresizingMaskIntoConstraints = false

        view.addSubview(emojisKeyboard)
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant