Пример #1
0
		public Issue1097 ()
		{
			Grid grid = new Grid {
				RowSpacing = 0,
				ColumnSpacing = 0,
			};

			grid.AddRowDef(count: 2);
			grid.AddColumnDef(count : 2);

			grid.Children.Add(new BoxView() { Color = Color.Red });

			var v2 = new BoxView { Color = Color.Blue };
			Grid.SetColumn(v2, 1);
			grid.Children.Add(v2);

			var v3 = new BoxView { Color = Color.Green };
			Grid.SetRow(v3, 1);
			grid.Children.Add(v3);

			var v4 = new BoxView { Color = Color.Purple };
			Grid.SetRow(v4, 1);
			Grid.SetColumn(v4, 1);
			grid.Children.Add(v4);

			Content = grid;
		}
Пример #2
0
        public FontImageSourceGallery()
        {
            var grid = new Grid
            {
                HeightRequest   = 1696,
                WidthRequest    = 320,
                BackgroundColor = Color.Black
            };

            grid.AddRowDef(count: 53);
            grid.AddColumnDef(count: 10);

            var fontFamily = "";

            switch (Device.RuntimePlatform)
            {
            case Device.iOS:
                fontFamily = "Ionicons";
                break;

            case Device.UWP:
                fontFamily = "Assets/Fonts/ionicons.ttf#ionicons";
                break;

            case Device.Android:
            default:
                fontFamily = "fonts/ionicons.ttf#";
                break;
            }
        public FontImageSourceGallery()
        {
            var grid = new Grid
            {
                HeightRequest   = 1696,
                WidthRequest    = 320,
                BackgroundColor = Color.Black
            };

            grid.AddRowDef(count: 53);
            grid.AddColumnDef(count: 10);

            var fontFamily = "";

            switch (Device.RuntimePlatform)
            {
            case Device.iOS:
                fontFamily = "Ionicons";
                break;

            case Device.UWP:
                fontFamily = "Assets/Fonts/ionicons.ttf#ionicons";
                break;

            case Device.Android:
            default:
                fontFamily = "fonts/ionicons.ttf#";
                break;
            }

            var i = 0;

            foreach (char c in Ionicons)
            {
                grid.Children.Add(new Image
                {
                    //Source = new FontImageSource
                    //{
                    //	Glyph = c.ToString(),
                    //	FontFamily = fontFamily,
                    //	Size = 20
                    //},
                    BackgroundColor   = Color.Black,
                    VerticalOptions   = LayoutOptions.Center,
                    HorizontalOptions = LayoutOptions.Center,
                }, i % 10, i / 10);
                i++;
            }
            Content = new ScrollView
            {
                VerticalOptions   = LayoutOptions.FillAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                Content           = grid
            };
        }
Пример #4
0
        public Issue1097()
        {
            Grid grid = new Grid
            {
                RowSpacing    = 0,
                ColumnSpacing = 0,
            };

            grid.AddRowDef(count: 2);
            grid.AddColumnDef(count: 2);

            grid.Children.Add(new BoxView()
            {
                Color = Color.Red
            });

            var v2 = new BoxView {
                Color = Color.Blue
            };

            Grid.SetColumn(v2, 1);
            grid.Children.Add(v2);

            var v3 = new BoxView {
                Color = Color.Green
            };

            Grid.SetRow(v3, 1);
            grid.Children.Add(v3);

            var v4 = new BoxView {
                Color = Color.Purple
            };

            Grid.SetRow(v4, 1);
            Grid.SetColumn(v4, 1);
            grid.Children.Add(v4);

            Content = grid;
        }
Пример #5
0
        public FontImageSourceGallery()
        {
            var grid = new Grid
            {
                HeightRequest   = 1696,
                WidthRequest    = 320,
                BackgroundColor = Color.Black
            };

            grid.AddRowDef(count: 53);
            grid.AddColumnDef(count: 10);

            var fontFamily = "";

            switch (Device.RuntimePlatform)
            {
            case Device.macOS:
            case Device.iOS:
                fontFamily = "Ionicons";
                break;

            case Device.UWP:
                fontFamily = "Assets/Fonts/ionicons.ttf#ionicons";
                break;

            case Device.WPF:
            case Device.GTK:
                fontFamily = "Assets/ionicons.ttf#ionicons";
                break;

            case Device.Android:
            default:
                fontFamily = "fonts/ionicons.ttf#";
                break;
            }

            grid.Children.Add(new ImageButton
            {
                Source = new FontImageSource
                {
                    Glyph      = Ionicons[Ionicons.Length - 1].ToString(),
                    FontFamily = fontFamily,
                    Size       = 20
                },
            });

            var i = 1;

            foreach (char c in Ionicons)
            {
                grid.Children.Add(new Image
                {
                    Source = new FontImageSource
                    {
                        Glyph      = c.ToString(),
                        FontFamily = fontFamily,
                        Size       = 20
                    },
                    BackgroundColor   = Color.Black,
                    VerticalOptions   = LayoutOptions.Center,
                    HorizontalOptions = LayoutOptions.Center,
                }, i % 10, i / 10);
                i++;
            }
            Content = new ScrollView
            {
                VerticalOptions   = LayoutOptions.FillAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                Content           = grid
            };

            var tb1 = new ToolbarItem()
            {
                Text            = "tb1",
                IconImageSource = new FontImageSource()
                {
                    FontFamily = fontFamily,
                    Glyph      = '\uf101'.ToString()
                }
            };
            var tb2 = new ToolbarItem
            {
                Text            = "tb2 red",
                IconImageSource = new FontImageSource()
                {
                    FontFamily = fontFamily,
                    Glyph      = '\uf101'.ToString(),
                    Color      = Color.Red
                },
            };
            var tb3 = new ToolbarItem
            {
                Text            = "tb3 yellow",
                IconImageSource = new FontImageSource()
                {
                    FontFamily = fontFamily,
                    Glyph      = '\uf2c7'.ToString(),
                    Color      = Color.Yellow
                },
            };

            ToolbarItems.Add(tb1);
            ToolbarItems.Add(tb2);
            ToolbarItems.Add(tb3);
        }