Lnpopupcontroller: Labels overlapping buttons when UIBarButtonItem has custom view in it

Created on 27 Apr 2018  路  11Comments  路  Source: LeoNatan/LNPopupController

Description

If you use a UIBarButton with customview inside, the position of the labels are wrong and so they overlap (goes behind actually) the buttons.

From the following screenshot, the left button is the "custom" one, while the right one is a UIBarButtonItem with an image.

screen shot 2018-04-27 at 10 42 09

It does not matter if you provide (via constraints) an fixed size to the custom view inside, the problem still happens.

Steps to Reproduce

Add 2 buttons, one with custom view (fixed size will do) and another with an image.

Device, OS and Xcode Versions


I just tested on iOS11 but I've the feeling is not just in this version.

bug

All 11 comments

This was fixed鈥攕upposedly鈥攁 while ago. Could you please create a demo project with the assets you are using and the constraints you are setting on the items?

I modified the example project from this repo. You can download the source code here
https://www.dropbox.com/s/sj8qi1ud1gt7rts/LNPopupController-issue-260.zip?dl=0

Thanks

Thanks, I will soon.

@dral3x ,

First of all, your constraints are not active:

Fix it:

    [fixedButton.widthAnchor constraintEqualToConstant:40].active = YES;
    [fixedButton.heightAnchor constraintEqualToConstant:40].active = YES;

After that, the labels do not overlap the custom button but there is no margin. We should make a leading constraint but we don't have access to the label properties.

That should be handled by the framework.

Can you post a screenshot with the constraints fixed?

Before:
2018-04-28_07-48-42
After activate the constraints:
2018-04-28_07-50-12
It remains a small overlap but less important.

Doesn鈥檛 look good.

FYI I did some debugging and it seems that the framework is not able to detect the margin the buttons's container (a UIStackView on iOS11) has with its superview.

I was checking inside this method https://github.com/LeoNatan/LNPopupController/blob/master/LNPopupController/LNPopupController/Private/LNPopupBar.m#L626

@LeoNatan have you any update on this?

Thanks

Sorry, I have been very busy lately. I will look soon. Please don't delete your demo project.

Fixed

Was this page helpful?
0 / 5 - 0 ratings

Related issues

johnswifttt picture johnswifttt  路  5Comments

funkenstrahlen picture funkenstrahlen  路  3Comments

RajChanchal picture RajChanchal  路  3Comments

chauhan130 picture chauhan130  路  8Comments

PrakashMaharjan picture PrakashMaharjan  路  6Comments