| | |
| | | /// </summary> |
| | | public class RowLayout : ViewGroup |
| | | { |
| | | ///// <summary> |
| | | ///// OpenLeftMenuAction |
| | | ///// </summary> |
| | | //public Action OpenLeftMenuAction; |
| | | ///// <summary> |
| | | ///// OpenRightMenuAction |
| | | ///// </summary> |
| | | //public Action OpenRightMenuAction; |
| | | |
| | | /// <summary> |
| | | /// OpenMenuAction |
| | | /// </summary> |
| | | public Action OpenMenuAction; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 右边的视图列表 |
| | |
| | | |
| | | |
| | | IsShowLeft = true; |
| | | (viewGroup as UIScrollView).SetContentOffset(new CGPoint(leftView[0].RealView.Frame.X, 0), false); |
| | | (viewGroup as UIScrollView).SetContentOffset(new CGPoint(leftView[0].RealView.Frame.X, 0), true); |
| | | OpenMenuAction?.Invoke(); |
| | | } |
| | | |
| | |
| | | return; |
| | | IsShowRight = true; |
| | | var rigthViewX = realViewGroup.Frame.X + GetAllRightViewWidth(); |
| | | (viewGroup as UIScrollView).SetContentOffset(new CGPoint(rigthViewX, 0), false); |
| | | (viewGroup as UIScrollView).SetContentOffset(new CGPoint(rigthViewX, 0), true); |
| | | OpenMenuAction?.Invoke(); |
| | | |
| | | } |
| | |
| | | HideAllMenuView(); |
| | | } |
| | | |
| | | void RestMenuView() |
| | | { |
| | | void RestMenuView() { |
| | | if (IsShowRight) |
| | | { |
| | | OpenRightMenu(); |
| | |
| | | OpenLeftMenu(); |
| | | |
| | | } |
| | | else |
| | | { |
| | | else { |
| | | HideAllMenuView(); |
| | | } |
| | | |
| | |
| | | /// 获取当前leftView的总宽 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | int GetAllLeftViewWidth() |
| | | { |
| | | int GetAllLeftViewWidth() { |
| | | int mWidth = 0; |
| | | foreach (var mView in leftView) |
| | | { |
| | |
| | | } |
| | | |
| | | RefreshContentSize(); |
| | | |
| | | // var menuWidth = GetAllLeftViewWidth() + GetAllRightViewWidth(); |
| | | // (viewGroup as UIScrollView).ContentSize = new CoreGraphics.CGSize(menuWidth + realViewGroup.Frame.Width, 0); |
| | | //(viewGroup as UIScrollView).SetContentOffset(new CGPoint(realViewGroup.Frame.X, 0), false); |
| | | } |
| | | |
| | | void RefreshContentSize() |
| | | { |
| | | void RefreshContentSize() { |
| | | var menuWidth = GetAllLeftViewWidth() + GetAllRightViewWidth(); |
| | | (viewGroup as UIScrollView).ContentSize = new CoreGraphics.CGSize(menuWidth + realViewGroup.Frame.Width, 0); |
| | | (viewGroup as UIScrollView).SetContentOffset(new CGPoint(realViewGroup.Frame.X, 0), false); |
| | |
| | | rigthView.Add(view); |
| | | |
| | | RefreshContentSize(); |
| | | |
| | | // (viewGroup as UIScrollView).ContentSize = new CoreGraphics.CGSize((leftView.Count + rigthView.Count) * SubViewWidth + realViewGroup.Frame.Width, 0); |
| | | //(viewGroup as UIScrollView).SetContentOffset(new CGPoint(realViewGroup.Frame.X, 0), false); |
| | | |
| | | } |
| | | |
| | | nfloat beforeXScrollX; |
| | |
| | | |
| | | } |
| | | |
| | | void GetMovePageIndex() |
| | | { |
| | | void GetMovePageIndex(){ |
| | | |
| | | if (20 < Math.Abs(moveX)) |
| | | { |