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

C# LinearLayout.LayoutParams类代码示例

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

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



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

示例1: OnCreateView

		public override View OnCreateView (LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle)
		{
			var frame = (FrameLayout)layoutInflater.Inflate(Resource.Layout.zxingscannerfragmentlayout, null);

			var layoutParams = new LinearLayout.LayoutParams (ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent);
							
			try
			{
				scanner = new ZXingSurfaceView (this.Activity, ScanningOptions, callback);
				frame.AddView(scanner, layoutParams);


				if (!UseCustomView)
				{
					zxingOverlay = new ZxingOverlayView (this.Activity);
					zxingOverlay.TopText = TopText ?? "";
					zxingOverlay.BottomText = BottomText ?? "";

					frame.AddView (zxingOverlay, layoutParams);
				}
				else if (CustomOverlayView != null)
				{
					frame.AddView(CustomOverlayView, layoutParams);
				}
			}
			catch (Exception ex)
			{
				Console.WriteLine ("Create Surface View Failed: " + ex);
			}
			return frame;
		}
开发者ID:sjller,项目名称:ZXing.Net.Mobile,代码行数:31,代码来源:ZXingScannerFragment.cs


示例2: onCreate

        /// <summary>
        /// Construct the UI and start loading
        /// </summary>
		public void onCreate()
		{
			string startUrl = webSettings.GetString ("url");
			string title = webSettings.GetString ("title");
			mainLayout = new LinearLayout (this.context);
			LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams (ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent, 0.0F);
			mainLayout.LayoutParameters = lp;
			((LinearLayout)mainLayout).SetGravity (GravityFlags.CenterVertical);
			((LinearLayout)mainLayout).Orientation = Orientation.Vertical;

			webView = new WebView (this.context);
			WebSettings settings = webView.Settings;
			settings.JavaScriptEnabled = true;
			settings.BuiltInZoomControls = true;
			settings.JavaScriptCanOpenWindowsAutomatically = true;

			webView.LayoutParameters = new LinearLayout.LayoutParams (ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent, 1.0F);

			webView.SetWebViewClient (new FHOAuthWebViewClient (this));
			webView.RequestFocusFromTouch ();
			webView.Visibility = ViewStates.Visible;

			LinearLayout barlayout = initHeaderBar (title);

			mainLayout.AddView (barlayout);
			mainLayout.SetBackgroundColor (Color.Transparent);
			mainLayout.SetBackgroundResource (0);
			mainLayout.AddView (this.webView);

			this.webView.LoadUrl (startUrl);

		}
开发者ID:secondsun,项目名称:fh-dotnet-sdk,代码行数:35,代码来源:FHOAuthWebview.cs


示例3: Initialize

        void Initialize()
        {
            Orientation = Orientation.Horizontal;

            var ps = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.MatchParent,
                                                    LinearLayout.LayoutParams.MatchParent,
                                                    1.0f);
            ps.SetMargins (0, 0, 0, 0);

            mLeftView = new CardboardOverlayEyeView (Context);
            mLeftView.LayoutParameters = ps;
            AddView(mLeftView);

            mRightView = new CardboardOverlayEyeView (Context);
            mRightView.LayoutParameters = ps;
            AddView(mRightView);

            // Set some reasonable defaults.
            SetDepthOffset(0.016f);

            SetColor(Color.Rgb (150, 255, 180));
            Visibility = ViewStates.Visible;

            mTextFadeAnimation = new AlphaAnimation(1.0f, 0.0f);
            mTextFadeAnimation.Duration = 5000;
        }
开发者ID:namratasingh123,项目名称:CardboardMonkey,代码行数:26,代码来源:CardboardOverlayView.cs


示例4: 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


示例5: OnResume

		public override void OnResume ()
		{
			base.OnResume ();

			var layoutParams = new LinearLayout.LayoutParams (ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent);
			layoutParams.Weight = 1;

			try
			{
				scanner = new ZXingSurfaceView (this.Activity, ScanningOptions, Callback);

				frame.AddView(scanner, layoutParams);


				if (!UseCustomView)
				{
					zxingOverlay = new ZxingOverlayView (this.Activity);
					zxingOverlay.TopText = TopText ?? "";
					zxingOverlay.BottomText = BottomText ?? "";

					frame.AddView (zxingOverlay, layoutParams);
				}
				else if (CustomOverlayView != null)
				{
					frame.AddView(CustomOverlayView, layoutParams);
				}
			}
			catch (Exception ex)
			{
				Console.WriteLine ("Create Surface View Failed: " + ex);
			}
		}
开发者ID:Woo-Long,项目名称:ZXing.Net.Mobile,代码行数:32,代码来源:ZXingScannerFragment.cs


示例6: OnCreate

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

            SetContentView(Resource.Layout.ActivityControlsVisualPerformance);

            LinearLayout linearLayoutWrapper = FindViewById<LinearLayout>(Resource.Id.linearLayout_wrapper);

            Stopwatch = new Stopwatch();
            Stopwatch.Start();

            //TODO: test Out of memory
            for (int j = 0; j < 450; j++)
            {
                LinearLayout linearLayout = new LinearLayout(this);
                LinearLayout.LayoutParams linearLayoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.WrapContent);
                linearLayout.Orientation = Orientation.Horizontal;
                linearLayoutWrapper.AddView(linearLayout, linearLayoutParams);

                for (int i = 0; i < 20; i++)
                {
                    Button button = new Button(this);
                    button.Text = "X";
                    button.Click += Button_Click;
                    linearLayoutParams = new LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.WrapContent);
                    linearLayoutParams.Weight = 1;
                    linearLayout.AddView(button, linearLayoutParams);
                }
            }
        }
开发者ID:darochapires,项目名称:XamarinBenchmark,代码行数:30,代码来源:ActivityControlsVisualPerformance.cs


示例7: OnCreateView

        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            rootview = (RelativeLayout)inflater.Inflate (Resource.Layout.raffleroot, container, false);
            locationcontainerlayout=(LinearLayout)rootview.FindViewById (Resource.Id.raffleroot_locationcontainer_linerlayout);

            TextView locationtext=new TextView(nn_activity);
            locationtext.Text=nn_location;
            LinearLayout.LayoutParams param=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WrapContent,LinearLayout.LayoutParams.WrapContent);
            param.Gravity=global::Android.Views.GravityFlags.Center;
            param.LeftMargin=TapUtil.dptodx(5);
            locationtext.LayoutParameters=param;
            locationcontainerlayout.AddView (locationtext);

            //initialize listview
            listview=(ListView)rootview.FindViewById(Resource.Id.raffleroot_eventlist_listview);
            listview.Divider = null;
            adapter = new EventListAdapter (nn_activity,eventcards);
            listview.Adapter = adapter;
            //adapter.NotifyListChange ();

            listview.ItemClick+= (object sender, AdapterView.ItemClickEventArgs e) => {
                (nn_activity as HomeScreen).ShowRaffleDetailFragment(e.Position);

            };

            return rootview;
        }
开发者ID:MADMUC,项目名称:TAP5050,代码行数:27,代码来源:RaffleRootFragment.cs


示例8: OnCreate

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

			this.RequestWindowFeature (WindowFeatures.NoTitle);

			this.Window.AddFlags (WindowManagerFlags.Fullscreen); //to show
			this.Window.AddFlags (WindowManagerFlags.KeepScreenOn); //Don't go to sleep while scanning

			scanner = new ZxingSurfaceView (this, ScanningOptions);
			SetContentView (scanner);

			var layoutParams = new LinearLayout.LayoutParams (ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent);

			if (!UseCustomView)
			{
				zxingOverlay = new ZxingOverlayView (this);
				zxingOverlay.TopText = TopText ?? "";
				zxingOverlay.BottomText = BottomText ?? "";

				this.AddContentView (zxingOverlay, layoutParams);
			}
			else if (CustomOverlayView != null)
			{
				this.AddContentView(CustomOverlayView, layoutParams);
			}

			OnCancelRequested += HandleCancelScan;
			OnAutoFocusRequested += HandleAutoFocus;
			OnTorchRequested += HandleTorchRequested;

		}
开发者ID:rfosterfrss,项目名称:ZXing.Net.Mobile,代码行数:32,代码来源:ZxingActivity.cs


示例9: Calendar_DaySlotLoading

        private void Calendar_DaySlotLoading(object sender, CalendarDaySlotLoadingEventArgs e)
        {
            // get day
            Java.Util.Date date = e.Date;
            Java.Util.Calendar cal = Java.Util.Calendar.GetInstance(Java.Util.Locale.English);
            cal.Time = date;
            int day = cal.Get(Java.Util.CalendarField.DayOfMonth);

            // create day slot layout container
            CalendarDaySlotBase layout = new CalendarDaySlotBase(ApplicationContext);
            layout.SetGravity(GravityFlags.Top);
            layout.SetVerticalGravity(GravityFlags.Top);
            layout.Orientation = Orientation.Vertical;
            layout.SetPadding(5, 5, 5, 5);
            LinearLayout.LayoutParams linearLayoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.FillParent);
            layout.LayoutParameters = linearLayoutParams;

            // create text element
            TextView tv = new TextView(ApplicationContext);
            //LinearLayout.LayoutParams linearLayoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent);
            //vv.LayoutParameters = linearLayoutParams;
            tv.Gravity = GravityFlags.Top;
            tv.Text = day.ToString();

            if (e.AdjacentDay)
            {
                // format adjacent day text
                tv.SetTextColor(Android.Graphics.Color.DarkGray);
            }

            // add text element to layout
            layout.AddView(tv);


            // add weather image for certain days
            if (day >= 14 && day <= 23)
            {
                ImageView iv = new ImageView(ApplicationContext);
                switch (day % 5)
                {
                    case 0: iv.SetImageResource(Resource.Drawable.Cloudy);
                        break;
                    case 1: iv.SetImageResource(Resource.Drawable.PartlyCloudy);
                        break;
                    case 2: iv.SetImageResource(Resource.Drawable.Rain);
                        break;
                    case 3: iv.SetImageResource(Resource.Drawable.Storm);
                        break;
                    case 4: iv.SetImageResource(Resource.Drawable.Sun);
                        break;

                }
                layout.AddView(iv);
               
            }

            // finally, set layout to day slot
            e.DaySlot = layout;
        }
开发者ID:GoXuni,项目名称:Xamarin.Android-Samples,代码行数:59,代码来源:MainActivity.cs


示例10: BaseMenu

        public BaseMenu(Context context)
            : base(context)
        {
            LayoutParameters = new LinearLayout.LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent);

            Alpha = 0.0f;
            Visibility = ViewStates.Gone;
        }
开发者ID:CartoDB,项目名称:mobile-dotnet-samples,代码行数:8,代码来源:BaseMenu.cs


示例11: SwitchToFirstLayout

		void SwitchToFirstLayout ()
		{
			firstLayout.Visibility = ViewStates.Visible;
			var parms = secondLayout.LayoutParameters as LinearLayout.LayoutParams;
			parms = new LinearLayout.LayoutParams (parms);
			parms.Height = 1;
			parms.Gravity = GravityFlags.Center;
			secondLayout.LayoutParameters = parms;
		}
开发者ID:GSerjo,项目名称:Seminars,代码行数:9,代码来源:LayoutAnimationFragment.cs


示例12: SwitchToSecondLayout

		void SwitchToSecondLayout ()
		{
			var parms = secondLayout.LayoutParameters as LinearLayout.LayoutParams;
			parms = new LinearLayout.LayoutParams (parms);
			parms.Height = ViewGroup.LayoutParams.WrapContent;
			parms.Gravity = GravityFlags.Center;

			secondLayout.LayoutParameters = parms;
			firstLayout.Visibility = ViewStates.Gone;
		}
开发者ID:GSerjo,项目名称:Seminars,代码行数:10,代码来源:LayoutAnimationFragment.cs


示例13: GetPropertyWindowLayout

        public override View GetPropertyWindowLayout(Android.Content.Context context)
        {
            /**
     * Property Window
     * */
            int width = (context.Resources.DisplayMetrics.WidthPixels) / 2;
            LinearLayout propertylayout = new LinearLayout(context); //= new LinearLayout(context);
            propertylayout.Orientation = Android.Widget.Orientation.Vertical;

            LinearLayout.LayoutParams layoutParams1 = new LinearLayout.LayoutParams(
                width * 2, 5);

            layoutParams1.SetMargins(0, 20, 0, 0);

            TextView labelDisplayMode = new TextView(context);
            labelDisplayMode.TextSize = 20;
            labelDisplayMode.Text = "LabelDisplay Mode";

            Spinner selectLabelMode = new Spinner(context);
            
            List<String> adapter = new List<String>() { "FloatAllPoints", "NearestPoint", "GroupAllPoints" };
            ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>
                (context, Android.Resource.Layout.SimpleSpinnerItem, adapter);
            dataAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleDropDownItem1Line);
            selectLabelMode.Adapter = dataAdapter;

            selectLabelMode.ItemSelected += (object sender, AdapterView.ItemSelectedEventArgs e) =>
            {
                String selectedItem = dataAdapter.GetItem(e.Position);
                ChartTrackballBehavior trackballBehavior = (chart.Behaviors.Get(0) as ChartTrackballBehavior);
                if (selectedItem.Equals("NearestPoint"))
                {
                    trackballBehavior.LabelDisplayMode = TrackballLabelDisplayMode.NearestPoint;
                }
                else if (selectedItem.Equals("FloatAllPoints"))
                {
                    trackballBehavior.LabelDisplayMode = TrackballLabelDisplayMode.FloatAllPoints;
                }
                else if (selectedItem.Equals("GroupAllPoints"))
                {
                    trackballBehavior.LabelDisplayMode = TrackballLabelDisplayMode.GroupAllPoints;
                }
            };

            propertylayout.AddView(labelDisplayMode);
            SeparatorView separate = new SeparatorView(context, width * 2);
            separate.LayoutParameters = new ViewGroup.LayoutParams(width * 2, 5);
            propertylayout.AddView(separate, layoutParams1);
            propertylayout.AddView(selectLabelMode);

           

            return propertylayout;
        }
开发者ID:IanLeatherbury,项目名称:tryfsharpforms,代码行数:54,代码来源:Trackball.cs


示例14: OnCreate

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

			this.RequestWindowFeature(WindowFeatures.NoTitle);

			this.Window.AddFlags(WindowManagerFlags.Fullscreen); //to show
			this.Window.AddFlags(WindowManagerFlags.KeepScreenOn); //Don't go to sleep while scanning

			scanner = new ZxingSurfaceView(this);
			SetContentView(scanner);

			var layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent);

			var customLayout = LayoutInflater.FromContext(this).Inflate(ZXing.YuvTool.Resource.Layout.Main, null);

			var buttonCapture = customLayout.FindViewById<Button>(ZXing.YuvTool.Resource.Id.MyButton);

			buttonCapture.Click += (sender, args) =>
				{
					var yuv = scanner.GetLastYuvImage();
					var width = scanner.GetLastWidth();
					var height = scanner.GetLastHeight();

					if (yuv == null)
						return;


					using (var stream = this.OpenFileOutput("YuvData.txt", FileCreationMode.WorldReadable))
					using (var sw = new System.IO.StreamWriter(stream))
					{
						sw.Write(Convert.ToBase64String(yuv.GetYuvData()));
						sw.WriteLine();
						sw.WriteLine("WIDTH=" + width + ", HEIGHT="+ height);
					}

					using (var stream = this.OpenFileOutput("YuvImage.jpg", FileCreationMode.WorldReadable))
					using (var sw = new System.IO.StreamWriter(stream))
					{
						yuv.CompressToJpeg(new Rect(0, 0, width, height), 100, stream);
					}

					var intent = new Intent(this, typeof (AnalyzeImageActivity));
					intent.PutExtra("IMGWIDTH", yuv.Width);
					intent.PutExtra("IMGHEIGHT", yuv.Height);
					StartActivity(intent);
				};
			
		
			this.AddContentView(customLayout, layoutParams);
		
		}
开发者ID:nagyist,项目名称:mini-hacks,代码行数:52,代码来源:Activity1.cs


示例15: OnCreate

        public override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            mView = new View(this.Activity);

            GradientDrawable background = (GradientDrawable) Resources.GetDrawable(Resource.Drawable.rounded_rect);
            background.SetColor(mColour);

            mView.SetBackgroundDrawable(background);
            LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(0, Xamarin.ActionbarSherlockBinding.App.ActionBar.LayoutParams.FillParent, mWeight);
            lp.SetMargins(marginLeft, marginTop, marginRight, marginBottom);
            mView.LayoutParameters = lp;
        }
开发者ID:kbalint,项目名称:SherlockTest,代码行数:13,代码来源:RoundedColourFragment.cs


示例16: GetSampleContent

		public override View GetSampleContent (Context con)
		{


            LinearLayout linear = new LinearLayout(con);
            linear.SetBackgroundColor(Color.White);
            linear.Orientation = Orientation.Vertical;
            linear.SetPadding(10, 10, 10, 10);

            TextView text1 = new TextView(con);
            text1.TextSize = 16;
            text1.SetTextColor(Color.ParseColor("#262626"));
            text1.Typeface = Typeface.DefaultBold;
            text1.Text = "Allowed Characters";
            text1.SetPadding(5, 10, 10, 5);
            linear.AddView(text1);

            TextView text2 = new TextView(con);
            text2.TextSize = 14;
            text2.SetTextColor(Color.ParseColor("#3F3F3F"));
            text2.Text = "All 128 ASCII Characters";
            text2.SetPadding(5, 5, 5, 5);
            LinearLayout text2Layout = new LinearLayout(con);
            LinearLayout.LayoutParams parms = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent);
            text2Layout.LayoutParameters = parms;
            text2Layout.AddView(text2);
            linear.AddView(text2Layout);

            LinearLayout barcodeLayout = new LinearLayout(con);
            barcodeLayout.SetPadding(0, 10, 0, 5);
            LinearLayout.LayoutParams parms1 = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent);
            barcodeLayout.LayoutParameters = parms1;

            barcode = new SfBarcode(con);
            barcode.Text = "G71C0453";
            Typeface fontFamily = Typeface.Create("helvetica", TypefaceStyle.Bold);
            barcode.TextFont = fontFamily;
            barcode.SetBackgroundColor(Color.ParseColor("#F2F2F2"));
            barcode.Symbology = BarcodeSymbolType.Code39Extended;
            barcode.TextSize = 20;

            Code39ExtendedSettings setting = new Code39ExtendedSettings();
            setting.BarHeight = 120;
            setting.NarrowBarWidth = 3;
            barcode.SymbologySettings = setting;
            barcodeLayout.AddView(barcode);
            linear.AddView(barcodeLayout);

            return linear;        
		}
开发者ID:IanLeatherbury,项目名称:tryfsharpforms,代码行数:50,代码来源:Code39Extended.cs


示例17: AddDevicesToFilterDialog

        private void AddDevicesToFilterDialog(Dialog dialog)
        {
            var layout = dialog.FindViewById<LinearLayout> (Resource.Id.SelectDeviceLayout);
            foreach (Device dev in UserDevices) {
                ToggleButton listItem = CreateDeviceSelectionItem (dev);

                LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
                    LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.WrapContent);
                layoutParams.SetMargins (5, 5, 5, 5);
                layoutParams.Height = 100;

                layout.AddView (listItem, layoutParams);
            }
        }
开发者ID:rockyhe,项目名称:MojioTowingAlert,代码行数:14,代码来源:NotificationsActivity.cs


示例18: GetSampleContent

		public override View GetSampleContent (Context con)
		{

            LinearLayout linear = new LinearLayout(con);
            linear.SetBackgroundColor(Color.White);
            linear.Orientation = Orientation.Vertical;
            linear.SetPadding(10, 10, 10, 10);

            TextView text1 = new TextView(con);
            text1.TextSize = 16;
            text1.SetTextColor(Color.ParseColor("#262626"));
            text1.Typeface = Typeface.DefaultBold;
            text1.Text = "Allowed Characters";
            text1.SetPadding(5, 10, 10, 5);
            linear.AddView(text1);

            TextView text2 = new TextView(con);
            text2.TextSize = 14;
            text2.SetTextColor(Color.ParseColor("#3F3F3F"));
            text2.Text = "ASCII values from 32 to 127\nSPACE ! \" # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \\ ]^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ DEL";
            text2.SetPadding(5, 5, 5, 5);
            LinearLayout text2Layout = new LinearLayout(con);
            LinearLayout.LayoutParams parms = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent);
            text2Layout.LayoutParameters = parms;
            text2Layout.AddView(text2);
            linear.AddView(text2Layout);

            LinearLayout barcodeLayout = new LinearLayout(con);
            barcodeLayout.SetPadding(0, 10, 0, 5);
            LinearLayout.LayoutParams parms1 = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent);
            barcodeLayout.LayoutParameters = parms1;

            barcode = new SfBarcode(con);
            barcode.Text = "ISBN-678504";
            Typeface fontFamily = Typeface.Create("helvetica", TypefaceStyle.Bold);
            barcode.TextFont = fontFamily;
            barcode.SetBackgroundColor(Color.ParseColor("#F2F2F2"));
            barcode.Symbology = BarcodeSymbolType.Code128B;
            barcode.TextSize = 20;

            Code128BSettings setting = new Code128BSettings();
            setting.BarHeight = 120;
            setting.NarrowBarWidth = 3;
            barcode.SymbologySettings = setting;
            barcodeLayout.AddView(barcode);
            linear.AddView(barcodeLayout);

            return linear;
		}
开发者ID:IanLeatherbury,项目名称:tryfsharpforms,代码行数:49,代码来源:Code128B.cs


示例19: GetSampleContent

		public override View GetSampleContent (Context con)
		{
            LinearLayout linear = new LinearLayout(con);
            linear.SetBackgroundColor(Color.White);
            linear.Orientation = Orientation.Vertical;
            linear.SetPadding(10, 10, 10, 10);

            TextView text1 = new TextView(con);
            text1.TextSize = 16;
            text1.SetTextColor(Color.ParseColor("#262626"));
            text1.Typeface = Typeface.DefaultBold;
            text1.Text = "Allowed Characters";
            text1.SetPadding(5, 10, 10, 5);
            linear.AddView(text1);

            TextView text2 = new TextView(con);
            text2.TextSize = 14;
            text2.SetTextColor(Color.ParseColor("#3F3F3F"));
            text2.Text = "ASCII values from 0 to 95\nNUL SOH STX ETX EOT ENQ ACK BEL BS HT LF VT FF CR SO SI DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US SPACE ! \" # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \\ ]^ _";
            text2.SetPadding(5, 5, 5, 5);
            LinearLayout text2Layout = new LinearLayout(con);
            LinearLayout.LayoutParams parms = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent);
            text2Layout.LayoutParameters = parms;
            text2Layout.AddView(text2);
            linear.AddView(text2Layout);

            LinearLayout barcodeLayout = new LinearLayout(con);
            barcodeLayout.SetPadding(0, 10, 0, 5);
            LinearLayout.LayoutParams parms1 = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent);
            barcodeLayout.LayoutParameters = parms1;

            barcode = new SfBarcode(con);
            barcode.Text = "ACL32 SF-D8";
            Typeface fontFamily = Typeface.Create("helvetica", TypefaceStyle.Bold);
            barcode.TextFont = fontFamily;
            barcode.SetBackgroundColor(Color.ParseColor("#F2F2F2"));
            barcode.Symbology = BarcodeSymbolType.Code128A;
            barcode.TextSize = 20;

            Code128ASettings setting = new Code128ASettings();
            setting.BarHeight = 120;
            setting.NarrowBarWidth = 3;
            barcode.SymbologySettings = setting;
            barcodeLayout.AddView(barcode);
            linear.AddView(barcodeLayout);

            return linear;
		}
开发者ID:IanLeatherbury,项目名称:tryfsharpforms,代码行数:48,代码来源:Code128A.cs


示例20: MultiItemRowListAdapter

        public MultiItemRowListAdapter(Context context, IListAdapter adapter, int itemsPerRow, int cellSpacing, bool canClickAtRow = false)
        {
            if (itemsPerRow <= 0) {
                throw new IllegalArgumentException("Number of items per row must be positive");
                }
                _contextReference = new WeakReference<Context>(context);
                _adapter = adapter;
                _itemsPerRow = itemsPerRow;
                _cellSpacing = cellSpacing;
            _canClickAtRow = canClickAtRow;

            _itemLayoutParams = new LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MatchParent);
                _itemLayoutParams.SetMargins(cellSpacing, cellSpacing, 0, 0);
                _itemLayoutParams.Weight = 1;
                _rowLayoutParams = new AbsListView.LayoutParams(AbsListView.LayoutParams.MatchParent, AbsListView.LayoutParams.WrapContent);
        }
开发者ID:okrotowa,项目名称:Yorsh,代码行数:16,代码来源:MultiItemRowListAdapter.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Link类代码示例发布时间:2022-05-24
下一篇:
C# LinearLayout类代码示例发布时间: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