Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] SlideMenu not displayed, when MenuContainerPage is Detail in a MasterDetailView and MenuOrientation is RightToLeft #68

Open
Stoni19781 opened this issue Apr 3, 2018 · 2 comments

Comments

@Stoni19781
Copy link

Stoni19781 commented Apr 3, 2018

We placed a MenuContainerPage with a SlideMenu as a DetailPage inside a MasterDetailPage. When we set MenuOrientation "RightToLeft", the SlideMenu is not visible anymore (LeftToRight is working). We found out, that SlideOverKitiOSHandler sets ScreenHelper.ScreenWidth to the width of the MainScreen (SlideOverKitiOSHandler does that). The SlideMenu is not visible, because it is "offscreen", as the DetailView's width is only about 2/3 the size of the Mainscreen and therefore the slideMenu's display position is far to right.

A solution would be to set ScreenSizeHelper.ScreenWidth to the width of the DetailPage. Unfortunately, the with is always -1. As a workaround, we manually adjust the ScreenWidth in SlideOverKitiOSHandler (in OnElementChanged_Event-Handler ~ line 277):

var parent = (_basePage as ContentPage).Parent as MasterDetailPage;
if (parent != null && DeviceIsHorizontal())
{
ScreenSizeHelper.ScreenWidth = UIScreen.MainScreen.Bounds.Width * 0.67; //<--magic number workaround / slidemenu is placed to far right, when page is detail-page inside masterdetail-page
}
else
{
ScreenSizeHelper.ScreenWidth = UIScreen.MainScreen.Bounds.Width;
}

We would be happy, if you could provide a solution for this, so we can use nuget for our iOS -project again :-)

Thank you very much in advance.

@jessejiang0214
Copy link
Contributor

Hi @Stoni19781 would you please give me some demo to reproduce this?
Maybe there's a better way to do this without changing the source code.

@Stoni19781
Copy link
Author

Hello Jessejiang0214,

sorry, that my answer took me so long, as i had been assigned to another project.

I modified your slideoverkit-Example-Project "SlideOverKitMoreSamples". Therefore i added a MasterDetailPage, which holds your QuickInnerMenuPage as the DetailPage. Then i modified the MainPage,so that my MasterDetailPage is loaded (instead of the QuickInnerMenuPage).

You can see the described behaviour in this example: Start the attached Project (it should compile and run). On the main menu, select QuickInnerMenu. When you select QuickMenu from Right, you can now see, that the menu is not visible (in fact - it is out of the screen). If you select "Menu from left" or "..from top", you can see the menu.

I assume, that the value, which has been assigned to ScreenHelper.ScreenWidth is to big for this scenario (see description above).

I hope, the example works and helps to comprehend the problem. Thank you very much in advance. I am looking forward hearing from you.
SlideOverKit_MasterDetailDemo.zip

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

No branches or pull requests

2 participants