Skip to content
This repository was archived by the owner on Nov 29, 2022. It is now read-only.

customViewForEmptyDataSet: 1.8.1 #376

Open
aganjiuswo opened this issue Dec 20, 2017 · 6 comments
Open

customViewForEmptyDataSet: 1.8.1 #376

aganjiuswo opened this issue Dec 20, 2017 · 6 comments

Comments

@aganjiuswo
Copy link

CustomView have Button can't response Action, but 1.6.1 can response it.

@DNC-7
Copy link

DNC-7 commented Dec 26, 2017

same problem with you, have you resolved it?

@aganjiuswo
Copy link
Author

NO.After the change of version in the v1.6.1 will OK.

@Gavinooooo
Copy link

Author restricted only UIControl type or ContentView own talent possible immovable case (hitTest: withEvent: event)

yjyuanshuai pushed a commit to yjyuanshuai/DZNEmptyDataSet that referenced this issue Jan 9, 2018
@yjyuanshuai
Copy link

When I add some codes,this problem is resovled. I hope that will help you.

if (_customView) {
        //add by yj
        CGFloat topOffset = (self.verticalOffset > 0.0) ? self.verticalOffset : 0.0;
        CGFloat bottemOffset = (self.verticalOffset < 0.0) ? -self.verticalOffset : 0.0;
        [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-(topOffset)-[contentView]-(bottemOffset)-|" options:0 metrics:@{@"topOffset":@(topOffset), @"bottemOffset":@(bottemOffset)} views:@{@"contentView": self.contentView}]];
        //add end
        [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[customView]|" options:0 metrics:nil views:@{@"customView":_customView}]];
        [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[customView]|" options:0 metrics:nil views:@{@"customView":_customView}]];
    }

@yjyuanshuai
Copy link

this problem is similar to #263 and #265

@YuanJiaShuai
Copy link

Good

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants