Xamarin.Forms: How to expand row from listview over full screen after tap or click?

故事扮演 提交于 2020-02-02 11:07:45

问题


I have two cell templates that appears in ListView. After clicking or taping on a cell, loading the second expanded (resized) template which is longer and shows more information. Problem is that I would like second template to expand and extend over the entire screen (from the toolbar to the bottom), not only as much as the content of template. To be perfectly clear, I do not want to open up a new window (Navigation.PushAsync), but to expand whole content in full screen. For now I have a way to fix the height of the extended cell after clicking, but that's not what I want, because every mobile device is different and has a different resolution.

Is there any easy way to do this, or I have to use some Nuget?

Thanks in advance!


回答1:


For list view cell you could use a grid. Then binding width and height with a column definition. How to do it you can find on the internet. Screen width and height you can get in platform specific project. On android width you can get like that:

App.ScreenWidth = ( int )( Resources.DisplayMetrics.WidthPixels / Resources.DisplayMetrics.Density );

Something similar will be with height.



来源:https://stackoverflow.com/questions/40806805/xamarin-forms-how-to-expand-row-from-listview-over-full-screen-after-tap-or-cli

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!