예제 #1
0
        public UISingleDayView()
        {
            _title = new UILabel()
            {
                Font = UIFont.PreferredBody
            };
            this.Add(_title);

            _line = new CAShapeLayer()
            {
                FillColor = UIColor.LightGray.CGColor
            };
            this.Layer.AddSublayer(_line);

            _items = new UITableView()
            {
                SeparatorInset = UIEdgeInsets.Zero
            };
            if (UIDevice.CurrentDevice.CheckSystemVersion(9, 0))
            {
                // Stretch to full width even on iPad
                _items.CellLayoutMarginsFollowReadableWidth = false;
            }
            _scheduleSnapshot = new UIDayScheduleSnapshot();
            _scheduleSnapshot.OnRequestViewClass += new WeakEventHandler <ViewItemClass>(_scheduleSnapshot_OnRequestViewClass).Handler;
            _items.TableFooterView = _scheduleSnapshot;
            this.Add(_items);

            MainScreenViewController.ListenToTabBarHeightChanged(ref _tabBarHeightListener, delegate
            {
                _items.ContentInset = new UIEdgeInsets(0, 0, MainScreenViewController.TAB_BAR_HEIGHT, 0);
            });
        }
예제 #2
0
        public UISingleDayView()
        {
            _title = new UILabel()
            {
                Font = UIFont.PreferredBody
            };
            this.Add(_title);

            _buttonExpand = new UIButton(UIButtonType.System);
            _buttonExpand.SetImage(UIImage.FromBundle("ToolbarDown").ImageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate), UIControlState.Normal);
            nfloat radians180 = unchecked ((nfloat)Math.PI); // 180 degrees is exactly PI in radians

            _buttonExpand.Transform      = CGAffineTransform.MakeRotation(radians180);
            _buttonExpand.TouchUpInside += _buttonExpand_TouchUpInside;
            this.Add(_buttonExpand);

            _nothingDueText = new UILabel()
            {
                Font          = UIFont.PreferredBody,
                Text          = PowerPlannerResources.GetString("String_NothingDue"),
                TextAlignment = UITextAlignment.Center,
                TextColor     = UIColor.LightGray
            };
            this.Add(_nothingDueText);

            _line = new CAShapeLayer()
            {
                FillColor = UIColor.LightGray.CGColor
            };
            this.Layer.AddSublayer(_line);

            _items = new UITableView()
            {
                SeparatorInset = UIEdgeInsets.Zero
            };
            if (UIDevice.CurrentDevice.CheckSystemVersion(9, 0))
            {
                // Stretch to full width even on iPad
                _items.CellLayoutMarginsFollowReadableWidth = false;
            }
            _scheduleSnapshot = new UIDayScheduleSnapshot();
            _scheduleSnapshot.OnRequestViewClass += new WeakEventHandler <ViewItemClass>(_scheduleSnapshot_OnRequestViewClass).Handler;
            _items.TableFooterView = _scheduleSnapshot;
            this.Add(_items);

            MainScreenViewController.ListenToTabBarHeightChanged(ref _tabBarHeightListener, delegate
            {
                _items.ContentInset = new UIEdgeInsets(0, 0, MainScreenViewController.TAB_BAR_HEIGHT, 0);
            });
        }