当前位置: 首页>>代码示例>>C#>>正文


C# Forms.ContentView类代码示例

本文整理汇总了C#中Xamarin.Forms.ContentView的典型用法代码示例。如果您正苦于以下问题:C# ContentView类的具体用法?C# ContentView怎么用?C# ContentView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ContentView类属于Xamarin.Forms命名空间,在下文中一共展示了ContentView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MenuPage2

        public MenuPage2()
        {
            Icon = "MenuIcon.png";
            Title = "menu";
            BackgroundColor = Color.FromHex("333333");

            Menu = new MenuListView();

            var menuLabel = new ContentView
            {
                Padding = new Thickness(10, 36, 0, 5),
                Content = new Label
                {
                    TextColor = Color.FromHex("AAAAAA"),
                    Text = "MENU",
                }
            };

            var layout = new StackLayout
            {
                Spacing = 0,
                VerticalOptions = LayoutOptions.FillAndExpand
            };
            layout.Children.Add(menuLabel);
            layout.Children.Add(Menu);

            Content = layout;
        }
开发者ID:Kalle-kula,项目名称:TestApp,代码行数:28,代码来源:MenuPage2.cs

示例2: AlertDetailsPage

        public AlertDetailsPage(AlertNavigationPage alertManager)
        {
            // MAP MODULE
                // Address
                // Map
            // TEXT MODULE
                // Room -- Floor
            // SEND MODULE
                //Button

            // Create Screen Elements
            var button = new Button {
                Text = "Send Test Alert",
                TextColor = Color.White,
                BackgroundColor = Color.Red,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                MinimumHeightRequest = 100

            };
            button.Clicked += (sender, e) => {
                alertManager.SendAlert ();
            };

            // Create Screen Content
            Content = new ContentView {
                Content = new StackLayout {
                    Children = {
                        button
                    }
                }
            };
        }
开发者ID:PaceCreativeLabs,项目名称:PaceSafety-App,代码行数:32,代码来源:AlertDetailsPage.cs

示例3: RenderContent

        private void RenderContent()
        {
            ScrollView scrollview = new ScrollView() { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand};
            var rootLayout = new StackLayout() { BackgroundColor = Color.Black, Spacing = 15, Orientation = StackOrientation.Vertical, HorizontalOptions = LayoutOptions.FillAndExpand, Padding = new Thickness(0, 0, 0, 10) }; // Padding = new Thickness(45, 15, 45, 15),

            ContentView header = new ContentView() { BackgroundColor = Color.Black, HorizontalOptions = LayoutOptions.FillAndExpand, Padding = new Thickness(0, 80, 0, 0) };
            rootLayout.Children.Add(header);

            btnGoogleLogIn = new Button() {
                Text = " LOG IN WITH GOOGLE ",
                FontAttributes = FontAttributes.Bold,
                BackgroundColor = Color.Green,
                TextColor = Color.White,
                HorizontalOptions = LayoutOptions.Center
            };
            rootLayout.Children.Add(btnGoogleLogIn);

            scrollview.Content = rootLayout;

            if (Device.OS == TargetPlatform.Android)
            {
                scrollview.IsClippedToBounds = true;
            }

            Content = scrollview;
        }
开发者ID:Jake-a-Lake,项目名称:GaragePrincess,代码行数:26,代码来源:StartPage.cs

示例4: PoliciesWebPage

        public PoliciesWebPage()
        {
            // Set Page Title
            Title = "Pace Policies";

            var source = new UrlWebViewSource ();
            source.Url = "http://pace.edu/sexual-assault";
            var webView = new WebView {
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    VerticalOptions = LayoutOptions.FillAndExpand,
                    Source = source
            };
            webView.Navigating += (object sender, WebNavigatingEventArgs e) => {
                System.Diagnostics.Debug.WriteLine("Loading");
            };
            webView.Navigated += (object sender, WebNavigatedEventArgs e) => {
                System.Diagnostics.Debug.WriteLine("Done");
            };

            Content = new ContentView {
                Content = new StackLayout {
                    Children = {
                        webView
                    }
                }
            };
        }
开发者ID:PaceCreativeLabs,项目名称:PaceSafety-App,代码行数:27,代码来源:PoliciesWebPage.cs

示例5: TitleIXPage

        public TitleIXPage()
        {
            // Set Page Title
            Title = "Title IX Rights";

            var source = new UrlWebViewSource ();
            source.Url = "http://knowyourix.org/title-ix/title-ix-the-basics/";
            var webView = new WebView {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions = LayoutOptions.FillAndExpand,
                Source = source
            };
            webView.Navigating += (object sender, WebNavigatingEventArgs e) => {
                System.Diagnostics.Debug.WriteLine("Loading");
            };
            webView.Navigated += (object sender, WebNavigatedEventArgs e) => {
                System.Diagnostics.Debug.WriteLine("Done");
            };

            Content = new ContentView {
                Content = new StackLayout {
                    Children = {
                        webView
                    }
                }
            };
        }
开发者ID:PaceCreativeLabs,项目名称:PaceSafety-App,代码行数:27,代码来源:TitleIXPage.cs

示例6: MenuPage

        public MenuPage()
        {
            Icon = "settings.png";
            Title = "menu";
            BackgroundColor = Color.FromHex ("#003f77");

            Menu = new MenuListView ();

            var menuLabel = new ContentView {
                Padding = new Thickness (10, 15, 0, 15),
                VerticalOptions = LayoutOptions.Center,
                Content = new Label {
                    TextColor = Color.FromHex ("#ffffff"),
                    FontSize = 15,
                    Text = "Tristan Low \[email protected] ",
                }
            };

            var layout = new StackLayout {
                Spacing = 0,
                VerticalOptions = LayoutOptions.FillAndExpand
            };
            layout.Children.Add (menuLabel);
            layout.Children.Add (Menu);

            Content = layout;
        }
开发者ID:cthorne,项目名称:TeamBPlus,代码行数:27,代码来源:MenuPage.cs

示例7: InitializeComponent

 private void InitializeComponent() {
     this.LoadFromXaml(typeof(StandingsView));
     NameGrid = this.FindByName<Grid>("NameGrid");
     MessagesLayoutFrame = this.FindByName<AbsoluteLayout>("MessagesLayoutFrame");
     MessagesLayoutFrameInner = this.FindByName<ContentView>("MessagesLayoutFrameInner");
     MessagesListView = this.FindByName<ListView>("MessagesListView");
 }
开发者ID:JavierErdozain,项目名称:Events,代码行数:7,代码来源:StandingsView.xaml.g.cs

示例8: AlertPage

        public AlertPage()
        {
            // Set Page Navigation
            Title = "Alert!";

            alert = new Alert ();

            // Create Screen Elements
            var button = new Button {
                Text = "Send Test Alert",
                TextColor = Color.White,
                BackgroundColor = Color.Red,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                MinimumHeightRequest = 100

            };
            button.Clicked += (sender, e) => { fakeAlert(); };

            // Create Screen Content
            Content = new ContentView {
                Content = new StackLayout {
                    Children = {
                        button
                    }
                }
            };
        }
开发者ID:PaceCreativeLabs,项目名称:PaceSafety-App,代码行数:27,代码来源:AlertPage.cs

示例9: MenuPage

        public MenuPage()
        {
            Icon = "profile_filler.png";//"settings.png";
            Title = "menu"; // The Title property must be set.
            BackgroundColor = Color.FromHex ("#007064");

            Menu = new MenuListView ();

            var menuLabel = new ContentView {
                Padding = 10,
                Content = new Label {
                    TextColor = Color.White,
                    Text = "Menu",
                    XAlign = TextAlignment.Center,
                    FontSize = 20,
                    FontAttributes = FontAttributes.Bold
                }
            };

            StackLayout layout = new StackLayout {
                VerticalOptions = LayoutOptions.FillAndExpand,
                Orientation = StackOrientation.Vertical,
                Spacing = 0
            };

            layout.Children.Add (menuLabel);
            layout.Children.Add (Menu);

            Content = layout;
        }
开发者ID:jarade,项目名称:IAB330Project,代码行数:30,代码来源:MenuPage.cs

示例10: MenuPage

        public MenuPage()
        {
            Icon = "menu.png";
            Title = "menu"; // The Title property must be set.
            BackgroundColor = Color.FromHex("333333");

            Menu = new MenuListView();

            var menuLabel = new ContentView
            {
                Padding = new Thickness(10, 36, 0, 5),
                Content = new Label
                {
                    TextColor = Color.White, //Color.FromHex("AAAAAA"),
                    Text = StateService.GetInstance().AppName,
                    HorizontalOptions = LayoutOptions.Center
                }
            };

            var layout = new StackLayout
            {
                Spacing = 0,
                VerticalOptions = LayoutOptions.FillAndExpand
            };
            layout.Children.Add(menuLabel);
            layout.Children.Add(Menu);

            Content = layout;
        }
开发者ID:AzureDay,项目名称:2016-MobileApp,代码行数:29,代码来源:MenuPage.cs

示例11: BorderDisplayControl

		public BorderDisplayControl() {
			ContentView border = new ContentView();
			border.BackgroundColor = Color.Green;
			Content = border;
			label = new Label();
			border.Content = label;
		}
开发者ID:RMDesenvolvimento,项目名称:Xamarin,代码行数:7,代码来源:BorderEditControl.cs

示例12: LeadListHeaderView

        public LeadListHeaderView(Command newLeadTappedCommand)
        {
            _NewLeadTappedCommand = newLeadTappedCommand;

            #region title label
            Label headerTitleLabel = new Label()
            {
                Text = TextResources.Leads_LeadListHeaderTitle.ToUpperInvariant(),
                TextColor = Palette._003,
                FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)),
                FontAttributes = FontAttributes.Bold,
                HorizontalTextAlignment = TextAlignment.Start,
                VerticalTextAlignment = TextAlignment.Center
            };
            #endregion

            #region new lead image "button"
            var newLeadImage = new Image
            {
                Source = new FileImageSource { File = Device.OnPlatform("add_ios_gray", "add_android_gray", null) },
                Aspect = Aspect.AspectFit, 
                HorizontalOptions = LayoutOptions.EndAndExpand,
            };
            //Going to use FAB
            newLeadImage.IsVisible = false;
            newLeadImage.GestureRecognizers.Add(new TapGestureRecognizer()
                {
                    Command = _NewLeadTappedCommand,
                    NumberOfTapsRequired = 1
                });
            #endregion

            #region absolutLayout
            AbsoluteLayout absolutLayout = new AbsoluteLayout();

            absolutLayout.Children.Add(
                headerTitleLabel, 
                new Rectangle(0, .5, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize), 
                AbsoluteLayoutFlags.PositionProportional);

            absolutLayout.Children.Add(
                newLeadImage, 
                new Rectangle(1, .5, AbsoluteLayout.AutoSize, .5), 
                AbsoluteLayoutFlags.PositionProportional | AbsoluteLayoutFlags.HeightProportional);
            #endregion

            #region setup contentView
            ContentView contentView = new ContentView()
            {
                Padding = new Thickness(10, 0), // give the content some padding on the left and right
                HeightRequest = RowSizes.MediumRowHeightDouble, // set the height of the content view
            };
            #endregion

            #region compose the view hierarchy
            contentView.Content = absolutLayout;
            #endregion

            Content = contentView;
        }
开发者ID:XnainA,项目名称:app-crm,代码行数:60,代码来源:LeadListHeaderView.cs

示例13: InitializeComponent

 private void InitializeComponent()
 {
     this.LoadFromXaml(typeof(MatrixView));
     grdRoot = this.FindByName<Grid>("grdRoot");
     cnvInfo = this.FindByName<ContentView>("cnvInfo");
     lblInfo = this.FindByName<Label>("lblInfo");
     cnvHeader = this.FindByName<ContentView>("cnvHeader");
     lblHeader1 = this.FindByName<Label>("lblHeader1");
     lblHeaderContent1 = this.FindByName<Label>("lblHeaderContent1");
     lblHeader2 = this.FindByName<Label>("lblHeader2");
     lblHeaderContent2 = this.FindByName<Label>("lblHeaderContent2");
     grdHeaderContent = this.FindByName<Grid>("grdHeaderContent");
     lblZ = this.FindByName<Label>("lblZ");
     lblZ1 = this.FindByName<Label>("lblZ1");
     lblZ2 = this.FindByName<Label>("lblZ2");
     lblZ3 = this.FindByName<Label>("lblZ3");
     lblZ4 = this.FindByName<Label>("lblZ4");
     lblZ5 = this.FindByName<Label>("lblZ5");
     lblZ6 = this.FindByName<Label>("lblZ6");
     lblD = this.FindByName<Label>("lblD");
     lblD1 = this.FindByName<Label>("lblD1");
     lblD2 = this.FindByName<Label>("lblD2");
     lblD3 = this.FindByName<Label>("lblD3");
     lblD4 = this.FindByName<Label>("lblD4");
     lblD5 = this.FindByName<Label>("lblD5");
     lblD6 = this.FindByName<Label>("lblD6");
     stkChart = this.FindByName<StackLayout>("stkChart");
     lblStatus = this.FindByName<Label>("lblStatus");
     cnvMatrix = this.FindByName<ContentView>("cnvMatrix");
 }
开发者ID:LordOfSmiles,项目名称:MatrixBuilderTest,代码行数:30,代码来源:MatrixBuilderTest.Views.MatrixView.xaml.g.cs

示例14: MenuPage

        public MenuPage()
        {
            Icon = "settings.png";
            Title = "menu"; // The Title property must be set.
            Menu = new MenuListView ();

            var menuLabel = new ContentView {
                Padding = new Thickness (10, 36, 0, 5),
                Content = new Label {
                    TextColor = Color.FromHex ("AAAAAA"),
                    Text = "MENU",
                }
            };

            //this.Padding = new Thickness(10, Device.OnPlatform(50, 0, 0), 10, 5);

            var layout = new StackLayout {
                Spacing = 0,
                VerticalOptions = LayoutOptions.FillAndExpand
            };
            layout.Children.Add (menuLabel);
            layout.Children.Add (Menu);

            Content = layout;
        }
开发者ID:henrytranvan,项目名称:HSFFinance,代码行数:25,代码来源:MenuPage.cs

示例15: NewImagePage

        public NewImagePage()
        {
            mImage = new Image
            {
                Source = "http://developer.xamarin.com/demo/IMG_1415.JPG?width=512"
            };

            tapPointsLayout = new AbsoluteLayout
            {
                VerticalOptions = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.Center,
                BackgroundColor = Color.Teal
            };
            tapPointsLayout.Children.Add(mImage);

            imageContainer = new ContentView
            {
                Content = tapPointsLayout,
                VerticalOptions = LayoutOptions.FillAndExpand,
                BackgroundColor = Color.Yellow
            };
            imageContainer.SizeChanged += imageContainer_SizeChanged;

            Content = new StackLayout
            {
                Children = {
                    new Label { Text = "Hello ContentPage" },
                    imageContainer,
                    new Label { Text = "PAUL IS COOL"}
                }
            };

            //Content.SizeChanged += Content_SizeChanged;
        }
开发者ID:private-boolean,项目名称:GestureSample,代码行数:34,代码来源:NewImagePage.cs


注:本文中的Xamarin.Forms.ContentView类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。