• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# RelativeLayout类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: OrderListHeaderView

        public OrderListHeaderView()
        {
            HeightRequest = Sizes.LargeRowHeight;

            #region add new order image
            AddNewOrderImage = new Image()
            {
                Aspect = Aspect.AspectFit
            };
            Device.OnPlatform(
                iOS: () => AddNewOrderImage.Source = new FileImageSource(){ File = "add_ios_blue" }, 
                Android: () => AddNewOrderImage.Source = new FileImageSource() { File = "add_android_blue" }
            );

            AddNewOrderImage.IsVisible = Device.OS != TargetPlatform.Android;
            #endregion

            #region add new order label
            AddNewOrderTextLabel = new Label
            {
                Text = TextResources.Customers_Orders_NewOrder.ToUpper(),
                TextColor = Palette._004,
                XAlign = TextAlignment.Start,
                YAlign = TextAlignment.Center,
            };
            #endregion

            #region compose view hierarchy
            BoxView bottomBorder = new BoxView() { BackgroundColor = Palette._013, HeightRequest = 1 };

            const double imagePaddingPercent = .35;

            RelativeLayout relativeLayout = new RelativeLayout();

            relativeLayout.Children.Add(
                view: AddNewOrderImage,
                yConstraint: Constraint.RelativeToParent(parent => parent.Height * imagePaddingPercent),
                xConstraint: Constraint.RelativeToParent(parent => parent.Height * imagePaddingPercent),
                widthConstraint: Constraint.RelativeToParent(parent => parent.Height - (parent.Height * imagePaddingPercent * 2)),
                heightConstraint: Constraint.RelativeToParent(parent => parent.Height - (parent.Height * imagePaddingPercent * 2)));

            relativeLayout.Children.Add(
                view: AddNewOrderTextLabel,
                xConstraint: Constraint.RelativeToView(AddNewOrderImage, (parent, view) => view.X + (view.Width / 2) + parent.Height * imagePaddingPercent),
                widthConstraint: Constraint.RelativeToView(AddNewOrderImage, (parent, view) => parent.Width - view.Width),
                heightConstraint: Constraint.RelativeToParent(parent => parent.Height)
            );

            relativeLayout.Children.Add(
                view: bottomBorder,
                yConstraint: Constraint.RelativeToParent(parent => parent.Height - 1),
                widthConstraint: Constraint.RelativeToParent(parent => parent.Width),
                heightConstraint: Constraint.Constant(1)
            );
            #endregion

           
            Content = relativeLayout;

        }
开发者ID:rsaggio,项目名称:app-crm,代码行数:60,代码来源:OrderListHeaderView.cs


示例2: Initialize

		void Initialize ()
		{
			this.LayoutParameters = new RelativeLayout.LayoutParams(-1,Configuration.getHeight (412));// LinearLayout.LayoutParams (Configuration.getWidth (582), Configuration.getHeight (394));
			this.SetGravity(GravityFlags.Center);


			image = new RelativeLayout(context);
			txtDescription = new TextView (context);
			txtTitle = new TextView (context);
			background = new LinearLayout (context);

			image.SetGravity (GravityFlags.Center);
			background.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (530), Configuration.getHeight (356));
			background.Orientation = Orientation.Vertical;
			background.SetBackgroundColor (Color.ParseColor ("#50000000"));

			image.LayoutParameters = new RelativeLayout.LayoutParams (Configuration.getWidth (582), Configuration.getHeight (394));

			txtTitle.SetTextColor (Color.ParseColor("#ffffff"));
			txtDescription.SetTextColor(Color.ParseColor("#ffffff"));
			txtTitle.SetTextSize (ComplexUnitType.Px, Configuration.getHeight (40));
			txtDescription.SetTextSize (ComplexUnitType.Px, Configuration.getHeight (30));

			background.AddView (txtTitle);
			background.AddView (txtDescription);



			image.AddView (background);

			this.AddView (image);
			//this.AddView (background);


		}
开发者ID:Milton761,项目名称:MLRepo,代码行数:35,代码来源:CustomerImageView.cs


示例3: GetView

		public override View GetView(Context context, View convertView, ViewGroup parent)
        {
			var view = convertView as RelativeLayout;
			
			if (view == null)
				view = new RelativeLayout(context);
						
            var parms = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent,
                                                        ViewGroup.LayoutParams.WrapContent);
            parms.SetMargins(5, 3, 5, 0);
            parms.AddRule((int) LayoutRules.AlignParentLeft);

            _caption = new TextView(context) {Text = Caption, TextSize = 16f};
            view.AddView(_caption, parms);

            if (!string.IsNullOrEmpty(Value))
            {
                var tparms = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent,
                                                             ViewGroup.LayoutParams.WrapContent);
                tparms.SetMargins(5, 3, 5, 0);
                tparms.AddRule((int) LayoutRules.AlignParentRight);

                _text = new TextView(context) {Text = Value, TextSize = 16f};
                view.AddView(_text, tparms);
            }

            return view;
        }
开发者ID:xlvisuals,项目名称:MonoDroid.Dialog,代码行数:28,代码来源:StringElement.cs


示例4: ContentDemo

        public ContentDemo()
        {
            Button button = new Button
            {
                Text = "Edit Profile",
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions = LayoutOptions.CenterAndExpand
            };
            button.Clicked += OnButtonClicked;

            Image myImage = new Image
            {
                Aspect = Aspect.Fill,
                Source = ImageSource.FromUri( new Uri(@"https://4e72eb44013d543eb0c67f8fbddf2ed30743ec8d.googledrive.com/host/0B70CO9lnNPfceHNFLXh2Wm8yMHc/List-Most-Expensive-Cars-photo-OdYL.jpg"))
            };
            this.Title = "Content Page";

            RelativeLayout relativeLayout = new RelativeLayout ();

            relativeLayout.Children.Add (myImage,
                Constraint.Constant (0),
                Constraint.Constant (0),
                Constraint.RelativeToParent ((parent) => { return parent.Width; }),
                Constraint.RelativeToParent ((parent) => { return parent.Height; }));

            relativeLayout.Children.Add (button,
                Constraint.RelativeToParent ((parent) => {return parent.Width/2;} ),
                Constraint.RelativeToParent ((parent) => {return parent.Height/2;} ),
                Constraint.RelativeToParent ((parent) => { return 75.0; }),
                Constraint.RelativeToParent ((parent) => { return 75.0; }));

            Content = relativeLayout;
        }
开发者ID:ctsxamarintraining,项目名称:cts440202,代码行数:33,代码来源:ContentDemo.cs


示例5: RelativeLayoutDemoCode

		public RelativeLayoutDemoCode ()
		{
			Title = "Relative Layout Demo - C#";
			outerLayout = new AbsoluteLayout ();
			layout = new RelativeLayout ();
			centerLabel = new Label { FontSize = 20, Text = "RelativeLayout Demo"};
			buttonLayout = new AbsoluteLayout ();
			box = new BoxView { Color = Color.Blue, HeightRequest = 50, WidthRequest = 50 };
			layout.Children.Add (box, Constraint.RelativeToParent ((parent) => {
				return (parent.Width * .5) - 50;
			}), Constraint.RelativeToParent ((parent) => {
				return (parent.Height * .1) - 50;
			}));
			layout.Children.Add (centerLabel, Constraint.RelativeToParent ((parent) => {
				return (parent.Width * .5) - 50;
			}), Constraint.RelativeToParent ((parent) => {
				return (parent.Height * .5) - 50;
			}));
			moveButton = new Button { BackgroundColor = Color.White, FontSize = 20, TextColor = Color.Lime, Text = "Move", BorderRadius = 0};
			buttonLayout.Children.Add (moveButton, new Rectangle(0,1,1,1), AbsoluteLayoutFlags.All);
			outerLayout.Children.Add (layout, new Rectangle(0,0,1,1), AbsoluteLayoutFlags.All);
			outerLayout.Children.Add (buttonLayout, new Rectangle(0,1,1,50), AbsoluteLayoutFlags.PositionProportional|AbsoluteLayoutFlags.WidthProportional);

			moveButton.Clicked += MoveButton_Clicked;
			x = 0f;
			y = 0f;
			Content = outerLayout;
		}
开发者ID:RickySan65,项目名称:xamarin-forms-samples,代码行数:28,代码来源:RelativeLayoutDemoCode.cs


示例6: AddSpinner

        public void AddSpinner(ViewGroup rootview,string loadingtext)
        {
            loading = true;
            if(loadingcontainer==null||(loadingcontainer!=null&&!loadingcontainer.IsShown)){
                loadingcontainer = new RelativeLayout (nn_activity);
                loadingcontainer.LayoutParameters = new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent);
                loadingcontainer.SetBackgroundColor (Color.White);

                var detailcontainer = new LinearLayout (nn_activity);

                detailcontainer.Orientation = Orientation.Vertical;
                RelativeLayout.LayoutParams param = new RelativeLayout.LayoutParams ((int)TapUtil.dptodx (100), RelativeLayout.LayoutParams.WrapContent);
                param.AddRule (LayoutRules.CenterInParent);
                detailcontainer.LayoutParameters = param;

                LinearLayout.LayoutParams linearlayoutparm = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent);
                linearlayoutparm.Gravity = GravityFlags.CenterHorizontal;

                ProgressBar progressbar = new ProgressBar (nn_activity);
                progressbar.LayoutParameters = linearlayoutparm;

                TextView tectview = new TextView (nn_activity);
                tectview.LayoutParameters = linearlayoutparm;
                tectview.Text = loadingtext;
                tectview.Gravity = GravityFlags.CenterHorizontal;

                detailcontainer.AddView (progressbar);
                detailcontainer.AddView (tectview);

                loadingcontainer.AddView (detailcontainer);
                rootview.AddView (loadingcontainer);
            }
        }
开发者ID:MADMUC,项目名称:TAP5050,代码行数:33,代码来源:Tap5050Fragment.cs


示例7: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            ActionBar.Hide();
            SetContentView(Resource.Layout.Main);
            cover = FindViewById<RelativeLayout>(Resource.Id.titleScreen);
            player = MediaPlayer.Create(this, Resource.Raw.avril_14th);
            toggleMusic = FindViewById<ToggleButton>(Resource.Id.toggleMusic);
            player.Start();
            player.Looping = true;

            cover.Click += delegate
            {
                StartActivity(typeof(Login));
            };


            toggleMusic.Click += (o, s) =>

            {
                if (toggleMusic.Checked)
                {
                    player.Start();
                    toggleMusic.SetBackgroundResource(Android.Resource.Drawable.IcMediaPause);

                }
                else
                {
                    toggleMusic.SetBackgroundResource(Android.Resource.Drawable.IcMediaPlay);
                    player.Pause();
                }
            };


        }
开发者ID:knervous,项目名称:MemoryBox,代码行数:35,代码来源:MainActivity.cs


示例8: MyRelativeLayout

		public MyRelativeLayout ()
		{
			var red = new Label {
				Text = "Stop", 
				BackgroundColor = Color.Red,
				Font = Font.SystemFontOfSize (20), 
				WidthRequest = 200, HeightRequest = 30
			};
			var yellow = new Label {
				Text = "Slow down", 
				BackgroundColor = Color.Yellow,
				Font = Font.SystemFontOfSize (20),
				WidthRequest = 160, HeightRequest = 160
			};
			var green = new Label {
				Text = "Go", 
				BackgroundColor = Color.Green,
				Font = Font.SystemFontOfSize (20),
				WidthRequest = 50, HeightRequest = 50
			};

			var relLayout = new RelativeLayout (); 
//			relLayout.Children.Add (red, new Point (20, 20));
//			relLayout.Children.Add (yellow, new Point (40, 60));
//			relLayout.Children.Add (green, new Point (80, 180));
//
			Content = relLayout;
		}
开发者ID:BobSchlitten,项目名称:xamarin-forms-samples,代码行数:28,代码来源:MyRelativeLayout.cs


示例9: MainViewModel

		public MainViewModel (RelativeLayout mainLayout, Context context)
		{
			_webService = ColorWebServices.Instance;
			_shapeFactory = ShapeFactory.Instance;
			_mainLayout = mainLayout;
			_context = context;
		}
开发者ID:jessejiang0214,项目名称:SwitchMediaTest,代码行数:7,代码来源:MainViewModel.cs


示例10: NavigationInfoButtonLayout

		public NavigationInfoButtonLayout ()
		{
			Image = new Image {
				Source = "vraagteken.png",
				Aspect = Aspect.AspectFill,
				Scale = 0.5
			};

			Button = new Button {
				BackgroundColor = Color.Transparent
			};

			var relativeLayout = new RelativeLayout {
				HeightRequest = 50,
				WidthRequest = 50
			};

			relativeLayout.Children.Add (Image,
				Constraint.Constant (0),
				Constraint.Constant (0),
				Constraint.RelativeToParent ((parent) => parent.Width),
				Constraint.RelativeToParent ((parent) => parent.Height));

			relativeLayout.Children.Add (Button,
				Constraint.Constant (0),
				Constraint.Constant (0),
				Constraint.RelativeToParent ((parent) => parent.Width),
				Constraint.RelativeToParent ((parent) => parent.Height));
			
			Children.Add (relativeLayout);
		}
开发者ID:RoyStobbelaar,项目名称:MedewerkerTemp,代码行数:31,代码来源:NavigationInfoButtonLayout.cs


示例11: RippleButton

		/// <summary>
		/// Initializes a new instance of the <see cref="NControl.Controls.RippleButton"/> class.
		/// </summary>
		public RippleButton()
		{            
            _layout = new RelativeLayout {IsClippedToBounds = true};

			// Add ripple thing
			_rippler = new RippleControl{
				InputTransparent = true,
			};
			_layout.Children.Add (_rippler, () => _layout.Bounds);

			// Add title and icon
            _labelText = new Label{ 
				BackgroundColor = Color.Transparent,
				XAlign = TextAlignment.Center,
				YAlign = TextAlignment.Center,
				TextColor = Color.Black,				
				InputTransparent = true,
			};
			
			_layout.Children.Add (_labelText, ()=> GetTextRectangleForImagePosition(_layout));

            _iconLabel = new FontAwesomeLabel{ 
				BackgroundColor = Color.Transparent,
				FontSize = 18,
				TextColor = (Color)IconColorProperty.DefaultValue,
				InputTransparent = true,
			};
			
			_layout.Children.Add (_iconLabel, () => GetIconRectangleForImagePosition(_layout));

			Content = _layout;
		}
开发者ID:patridge,项目名称:NControl.Controls,代码行数:35,代码来源:RippleButton.cs


示例12: XFPage3

        public XFPage3()
        {
            var layout = new RelativeLayout();
            var label = new Label()
            {
                Text = "This is a line of text!"
            };
            layout.Children.Add(label, Constraint.Constant(0),
                Constraint.RelativeToParent(parent => parent.Height / 2));

            var label2 = new Label() { Text = "More text over here!" };

            layout.Children.Add(label2, Constraint.RelativeToView(label, (parent, otherView) => otherView.X + otherView.Width), Constraint.RelativeToView(label, (parent, otherView) => otherView.Y - otherView.Height));

            var label3 = new Label() { Text = "Final text" };

            layout.Children.Add(label3, Constraint.RelativeToView(label2, (parent, otherView) =>
            {
                return (otherView.X + otherView.Width) - label3.Width;
            }),
                Constraint.RelativeToView(label, (parent, otherView) => { return otherView.Y; }));

            label3.SizeChanged += (o, e) => { layout.ForceLayout(); };

            Content = layout;
        }
开发者ID:mkonkolowicz,项目名称:KnockKnock,代码行数:26,代码来源:XFPage3.cs


示例13: HomeButton

        public HomeButton(string iconText, string title, Color iconBGColor, Color titleBGColor)
        {
            IconLabel iconLabel = new IconLabel {
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions = LayoutOptions.Fill,
                BackgroundColor = iconBGColor,
                TextColor = Color.White,
                Text = iconText,
                FontSize = 60
            };

            Label titleLabel = new Label {
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions = LayoutOptions.Fill,
                BackgroundColor = titleBGColor,
                TextColor = Color.White,
                Text = title,
                FontSize = 14
            };

            RelativeLayout layout = new RelativeLayout ();
            layout.Children.Add (iconLabel,
                Constraint.Constant (0),
                Constraint.Constant (0),
                Constraint.RelativeToParent ((parent) => parent.Width),
                Constraint.RelativeToParent ((parent) => parent.Height));

            layout.Children.Add (titleLabel,
                Constraint.Constant (0),
                Constraint.RelativeToParent ((parent) => parent.Height * 0.75),
                Constraint.RelativeToParent ((parent) => parent.Width),
                Constraint.RelativeToParent ((parent) => parent.Height * 0.25));

            Content = layout;
        }
开发者ID:DaveCaldeira,项目名称:NavigationTest,代码行数:35,代码来源:HomeButton.cs


示例14: CardView

		public CardView()
		{
			HeightRequest = 6*UiConst.LINE_HEIGHT;
			WidthRequest = 320;
			BackgroundColor = Color.Maroon;
			Padding = new Thickness(2);

			var t = new TapGestureRecognizer();
			t.Tapped += new DenyAction<object, EventArgs>(MAnimation, 800).OnEvent;
			GestureRecognizers.Add(t);

			Content = (_rootLayout = new RelativeLayout()
			{
				HorizontalOptions = LayoutOptions.FillAndExpand,
				VerticalOptions = LayoutOptions.FillAndExpand,
				BackgroundColor = UiConst.COLOR_DF_BG
			});

			Content.GestureRecognizers.Add(t);

			// init component
			_rootLayout.Children.Add(new MyLabel
			{
				BackgroundColor = Color.Pink
			}, null, null, null, Constraint.Constant(UiConst.LINE_HEIGHT));
		}
开发者ID:manhvvhtth,项目名称:xm-form,代码行数:26,代码来源:CardView.cs


示例15: OnCreate

		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
			
			_timestamp = DateTime.Now.ToLongTimeString ();
			
			// create a layout
			var rl = new RelativeLayout (this);
			var layoutParams = new RelativeLayout.LayoutParams (ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent);
			rl.LayoutParameters = layoutParams;
			
			// get the initial orientation
			var surfaceOrientation = this.WindowManager.DefaultDisplay.Rotation;
			
			// create the portrait and landscape layout
			_layoutParamsPortrait = new RelativeLayout.LayoutParams (ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.WrapContent);		
			_layoutParamsLandscape = new RelativeLayout.LayoutParams (ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.WrapContent);
			_layoutParamsLandscape.LeftMargin = 100;
			_layoutParamsLandscape.TopMargin = 100;
			
			// create the TextView an assign the initial layout params
			_tv = new TextView (this);
			
			if (surfaceOrientation == SurfaceOrientation.Rotation0 || surfaceOrientation == SurfaceOrientation.Rotation180) {
				_tv.LayoutParameters = _layoutParamsPortrait;
			} else {
				_tv.LayoutParameters = _layoutParamsLandscape;
			}
			
			_tv.Text = "Programmatic layout. Timestamp = " + _timestamp;
			
			rl.AddView (_tv);
	
			SetContentView (rl);
		}
开发者ID:89sos98,项目名称:monodroid-samples,代码行数:35,代码来源:CodeLayoutActivity.cs


示例16: Footer

		public Footer (ExtendedMap map, double pageHeight, double minimizedFooterY, double expandedFooterY)
		{
			_extendedMap = map;
			_uiHelper = new UIHelper ();
			_pageHeight = pageHeight;
			_minimizedFooterY = minimizedFooterY;
			_expandedFooterY = expandedFooterY;
			FooterMode = FooterMode.Hidden;

			var footerLayout = new RelativeLayout ();

			footerLayout.Children.Add (
				new FooterMaster(_extendedMap, _uiHelper, this),
				Constraint.RelativeToParent ((parent) => (parent.Width * 0)),
				Constraint.RelativeToParent ((parent) => (parent.Height * 0)),
				Constraint.RelativeToParent ((parent) => (parent.Width * 1)),
				Constraint.RelativeToParent ((parent) => (parent.Height * 0.15))
			);

			footerLayout.Children.Add (
				new FooterDetail(_uiHelper, _extendedMap, this),
				Constraint.RelativeToParent ((parent) => (parent.Width * 0)),
				Constraint.RelativeToParent ((parent) => (parent.Height * 0.149)),
				Constraint.RelativeToParent ((parent) => (parent.Width * 1)),
				Constraint.RelativeToParent ((parent) => (parent.Height * 1))
			);

			Content = footerLayout;
		}
开发者ID:patridge,项目名称:Xamarin.Forms.Plugins,代码行数:29,代码来源:Footer.cs


示例17: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.SplashScreenLayout);

            _splashLayout = FindViewById<RelativeLayout>(Resource.Id.SplashScreenLayout);
            _splashLayout.Visibility = ViewStates.Invisible;
            _fadeIn = AnimationUtils.LoadAnimation(this, Resource.Animation.splash_fade_in);
            _fadeOut = AnimationUtils.LoadAnimation(this, Resource.Animation.splash_fade_out);

            _fadeIn.AnimationEnd += (sender, e) =>
            {
                _splashLayout.StartAnimation(_fadeOut);
            };

            _fadeOut.AnimationEnd += (sender, e) =>
            {
                var intent = new Intent(this, typeof(MainActivity));
                StartActivity(intent);
                _splashLayout.Visibility = ViewStates.Gone;

                ThreadPool.QueueUserWorkItem(_ =>
                {
                    Finish();
                });
            };
        }
开发者ID:nickpeppers,项目名称:WKUACMApp,代码行数:28,代码来源:SplashScreenActivity.cs


示例18: MyPage

        public MyPage()
        {
            BackgroundColor = Color.White;

            var imgBackgrndImage = new Image () {
                //Source = ImageSource.FromResource ("EmbedImageEx.HomeBg.png"),
                // This one don't work which is from referenced PCL project MyImages used only for string embedded Images.
                Source = ImageSource.FromResource ("MyImages.HomeBg.png"),
                Aspect = Aspect.Fill
            };
            RelativeLayout lytMain = new RelativeLayout () {
                HeightRequest = 100,
            };

            lytMain.Children.Add (
                imgBackgrndImage,
                Constraint.Constant (0),
                Constraint.Constant (0),
                Constraint.RelativeToParent ((parent) => {
                    return parent.Width;
                }),
                Constraint.RelativeToParent ((parent) => {
                    return parent.Height;
                })
            );
            Content = lytMain;
        }
开发者ID:srkrathore,项目名称:EmbedImageEx,代码行数:27,代码来源:MyPage.cs


示例19: ProgressControl

        /// <summary>
        /// Initializes a new instance of the <see cref="NControlDemo.FormsApp.Controls.ProgressControl"/> class.
        /// </summary>
        public ProgressControl()
        {
            BackgroundColor = Xamarin.Forms.Color.Gray;

            var cog1 = new FontAwesomeLabel{ 
                Text = FontAwesomeLabel.FACog,
                FontSize = 39,
                TextColor = Xamarin.Forms.Color.FromHex("#CECECE"),
                XAlign = Xamarin.Forms.TextAlignment.Center,
                YAlign = Xamarin.Forms.TextAlignment.Center,
            };

            var cog2 = new FontAwesomeLabel{ 
                Text = FontAwesomeLabel.FACog,
                FontSize = 18,
                TextColor = Xamarin.Forms.Color.FromHex("#CECECE"),
                XAlign = Xamarin.Forms.TextAlignment.Center,
                YAlign = Xamarin.Forms.TextAlignment.Center,
            };
                
            _animation = new Animation((val) => {
                cog1.Rotation = val;
                cog2.Rotation = -val;
            }, 0, 360, Easing.Linear);

            var layout = new RelativeLayout();
            layout.Children.Add(cog1, () => new Xamarin.Forms.Rectangle((-layout.Width/4) + 8, (layout.Height/4) - 8, 
                layout.Width, layout.Height));
            
            layout.Children.Add(cog2, () => new Xamarin.Forms.Rectangle(layout.Width -36, -13, 
                layout.Width, layout.Width));

            Content = layout;
        }
开发者ID:rmawani,项目名称:NControl,代码行数:37,代码来源:ProgressControl.cs


示例20: Page1

		public Page1 ()
        {
            int o = App.ScreenHeight;
            int ov = App.ScreenWidth;
            #region All controls with click
            
            var b = new Button
			{ 
				Text = "Next Page",
				BackgroundColor=Xamarin.Forms.Color.Transparent,
				TextColor=Xamarin.Forms.Color.Pink,
			};
            b.Clicked += async (sender, e) =>
            {
                await Navigation.PushAsync(new Page2());
            };
            #endregion

            #region Main Layout 

            Title = "Page 1";
			BackgroundImage="Page1.png";
            var mainLayout = new RelativeLayout
            { 
                HorizontalOptions=LayoutOptions.Fill,
                VerticalOptions = LayoutOptions.Fill,                
			};
            //Initialization of this popview already on base page. Here we just add this popview in current page.
            mainLayout.Children.Add(PopupsView, Constraint.Constant(App.ScreenWidth), Constraint.Constant(0));
            mainLayout.Children.Add(b, Constraint.Constant(10), Constraint.Constant(15));           
           this. Content= mainLayout;
            #endregion

        }
开发者ID:XnainA,项目名称:PopUps-Menu,代码行数:34,代码来源:Page1.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# RelativePath类代码示例发布时间:2022-05-24
下一篇:
C# Relationship类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap