コード例 #1
0
        internal LegendItemView(Context context)
            : base(context)
        {
            Orientation      = Orientation.Vertical;
            LayoutParameters = new LayoutParams(LayoutParams.WrapContent, LayoutParams.WrapContent);
            SetGravity(GravityFlags.Top);

            _textView = new TextView(context)
            {
                LayoutParameters = new LayoutParams(LayoutParams.MatchParent, LayoutParams.WrapContent)
            };
            AddView(_textView);

            _layerLegend = new LayerLegend(context)
            {
                LayoutParameters        = new LayoutParams(LayoutParams.MatchParent, LayoutParams.WrapContent),
                ShowEntireTreeHierarchy = false
            };
            AddView(_layerLegend);

            _listView = new ListView(context)
            {
                LayoutParameters       = new LayoutParams(LayoutParams.MatchParent, LayoutParams.WrapContent),
                ScrollingCacheEnabled  = false,
                PersistentDrawingCache = PersistentDrawingCaches.NoCache,
            };
            AddView(_listView);
            RequestLayout();
        }
コード例 #2
0
        internal LegendItemView(Context context)
            : base(context)
        {
            Orientation      = Orientation.Vertical;
            LayoutParameters = new LayoutParams(LayoutParams.WrapContent, LayoutParams.WrapContent);
            SetGravity(GravityFlags.Top);

            _textView = new TextView(context)
            {
                LayoutParameters = new LayoutParams(LayoutParams.MatchParent, LayoutParams.WrapContent)
            };
            AddView(_textView);

            _layerLegend = new LayerLegend(context)
            {
                LayoutParameters = new LayoutParams(LayoutParams.MatchParent, LayoutParams.WrapContent),
                IncludeSublayers = false
            };
            AddView(_layerLegend);

            _listView = new ListView(context)
            {
                ClipToOutline          = true,
                Clickable              = false,
                ChoiceMode             = ChoiceMode.None,
                LayoutParameters       = new LayoutParams(LayoutParams.MatchParent, LayoutParams.WrapContent),
                ScrollingCacheEnabled  = false,
                PersistentDrawingCache = PersistentDrawingCaches.NoCache,
            };
            AddView(_listView);
            RequestLayout();
        }
コード例 #3
0
        public LegendItemCell(IntPtr handle)
            : base(handle)
        {
            SelectionStyle = UITableViewCellSelectionStyle.None;
            TranslatesAutoresizingMaskIntoConstraints = false;

            _textLabel = new UILabel()
            {
                LineBreakMode   = UILineBreakMode.TailTruncation,
                Font            = UIFont.SystemFontOfSize(UIFont.LabelFontSize),
                TextColor       = UIColor.Black,
                BackgroundColor = UIColor.Clear,
                ContentMode     = UIViewContentMode.Center,
                TextAlignment   = UITextAlignment.Left,
                TranslatesAutoresizingMaskIntoConstraints = false
            };

            _layerLegend = new LayerLegend()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                IncludeSublayers = false
            };

            _listView = new UITableView(UIScreen.MainScreen.Bounds)
            {
                ClipsToBounds   = true,
                ContentMode     = UIViewContentMode.ScaleAspectFill,
                SeparatorStyle  = UITableViewCellSeparatorStyle.None,
                AllowsSelection = false,
                Bounces         = true,
                TranslatesAutoresizingMaskIntoConstraints = false,
                AutoresizingMask   = UIViewAutoresizing.All,
                RowHeight          = UITableView.AutomaticDimension,
                EstimatedRowHeight = 100,
            };
            _listView.RegisterClassForCellReuse(typeof(LegendItemCell), LegendTableSource.CellId);

            ContentView.AddSubviews(_textLabel, _layerLegend, _listView);
        }