jsqmessageviewcontroller ios11 toolbar

前端 未结 8 1286
故里飘歌
故里飘歌 2020-12-16 05:01

I have tried the swift example of JSQMessageViewController inside iOS 11 simulator. Here is the result:screenshot

I have tried using safe area margin an

8条回答
  •  Happy的楠姐
    2020-12-16 05:42

    Found a solution without empty space below input toolbar on iPhoneX, the idea that not the whole toolbar self should be above the safe area, but only its self.contentView:

    -(void) didMoveToWindow{
        [super didMoveToWindow];
        if (@available(iOS 11.0, *)) {
            if (self.window.safeAreaLayoutGuide != nil) {
                [[self.contentView bottomAnchor] constraintLessThanOrEqualToSystemSpacingBelowAnchor:self.window.safeAreaLayoutGuide.bottomAnchor multiplier:1.0].active = YES;
            }
        }
    }
    

提交回复
热议问题