Skip to content

Conversation

@lxyzk
Copy link

@lxyzk lxyzk commented Jul 26, 2016

It seems that SlideMenuController has no chance to update the leftContainerView's width when I use the code as follows to set leftContainerView's width.

    SlideMenuController *smc = [[SlideMenuController alloc] initWithMainViewController:mnvc leftMenuViewController:svc];

    smc.option.leftViewWitdth = CGRectGetWidth(smc.view.bounds) * 0.723;

So When leftSlideMenu opened, the frame.size and origin.x don't correspond.

抱歉,我的英语不好。
就是我用上面的代码设置了左边栏的宽度后,如果宽度设置的比以前小,打开左边栏后不能完全收回去。因为计算origin.x时用的是新设置的宽度,而左边栏的宽度还是原来的宽度。

fix left and right view width
@Pluto-Y
Copy link
Owner

Pluto-Y commented Jul 26, 2016

@lxyzk Thanks for you PR.
我去,中文都出来了,话说我只看到你添加了left的KVO没看到你添加right的KVO,而且也没有removeObserver的方法,麻烦重新添加之后再调整。

@lxyzk
Copy link
Author

lxyzk commented Jul 27, 2016

首先说下抱歉,一开始没看到有changeLeftViewWidth方法,才用option去设置宽度发现没有效果,可能浪费你时间了。
我对KVO不是很熟悉,昨天的代码有不少问题,今天我重新调整了一下。

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

Successfully merging this pull request may close these issues.

2 participants