Skip to content

EmojiView showing as thin line within UIInputViewController #83

@RL-William-Coates

Description

@RL-William-Coates

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)
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions