當前位置: 首頁>>代碼示例>>C#>>正文


C# Grid.AddAutoColumnDefinition方法代碼示例

本文整理匯總了C#中Xamarin.Forms.Grid.AddAutoColumnDefinition方法的典型用法代碼示例。如果您正苦於以下問題:C# Grid.AddAutoColumnDefinition方法的具體用法?C# Grid.AddAutoColumnDefinition怎麽用?C# Grid.AddAutoColumnDefinition使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Xamarin.Forms.Grid的用法示例。


在下文中一共展示了Grid.AddAutoColumnDefinition方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: BaseContentPage

        protected BaseContentPage()
        {
            _contentView = new ContentView
            {
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions = LayoutOptions.Fill
            };

            _backgroundImage = new Image
            {
                Source = BackgroundImageSource,
                Opacity = BackgroundImageOpacity,
                Aspect = BackgroundImageAspect
            };

            _opacityGrid = CreateFillGrid();
            _opacityGrid.IsVisible = false;
            _opacityGrid.Opacity = 0.75;
            _opacityGrid.BackgroundColor = OpacityBackgroundColor;

            var activityGrid = new Grid
            {
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions = LayoutOptions.Center,
            };

            activityGrid.AddAutoRowDefinition();
            activityGrid.AddAutoRowDefinition();
            activityGrid.AddAutoColumnDefinition();
            
            _activityIndicator = new ActivityIndicator
            {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions = LayoutOptions.FillAndExpand,
                Color = Color.White
            };

            _activityLabel = new Label
            {
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions = LayoutOptions.Center,
                TextColor = Color.White,
                LineBreakMode = LineBreakMode.WordWrap
            };

            Grid.SetRow(_activityIndicator, 0);
            Grid.SetRow(_activityLabel, 1);

            activityGrid.Children.Add(_activityIndicator);
            activityGrid.Children.Add(_activityLabel);

            _activityFrame = new Frame
            {
                BackgroundColor = BusyIndicatorBackgroundColor,
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions = LayoutOptions.Center,
                Content = activityGrid,
                IsVisible = false
            };

            _seperator = new ProgressBar
            {
                VerticalOptions = LayoutOptions.Fill,
                IsVisible = ShowSeperator
            };

            _mainGrid = new Grid
            {
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions = LayoutOptions.Fill,
                RowSpacing = 0
            };

            _mainGrid.AddStarColumnDefinition();
            _mainGrid.AddAutoRowDefinition();
            _mainGrid.AddStarRowDefinition();

            _mainGrid.Children.Add(_backgroundImage);
            _mainGrid.Children.Add(_contentView);
            _mainGrid.Children.Add(_opacityGrid);
            _mainGrid.Children.Add(_activityFrame);
            _mainGrid.Children.Add(_seperator);
            
            Grid.SetRow(_contentView, 1);
            Grid.SetRow(_opacityGrid, 1);
            Grid.SetRow(_activityFrame, 1);
            Grid.SetRow(_backgroundImage, 1);
            Grid.SetRow(_seperator, 0);
            
            Content = _mainGrid;
            _mainGrid.IsVisible = false;
            Padding = new Thickness(0, Device.OnPlatform(20, 0, 0), 0, 0);
        }
開發者ID:jimbobbennett,項目名稱:JimLib.Xamarin,代碼行數:93,代碼來源:BaseContentPage.cs


注:本文中的Xamarin.Forms.Grid.AddAutoColumnDefinition方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。