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


C# TableRow.AddView方法代码示例

本文整理汇总了C#中TableRow.AddView方法的典型用法代码示例。如果您正苦于以下问题:C# TableRow.AddView方法的具体用法?C# TableRow.AddView怎么用?C# TableRow.AddView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TableRow的用法示例。


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

示例1: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            account_id = Intent.GetStringExtra("account_id");
            SetContentView(Resource.Layout.TotalsReport);
            Title = "Fund Totals - " + Db.getAccount(account_id).account_name;
            var scrollview = FindViewById<ScrollView>(Resource.Id.scrollview);

            var t = new TableLayout(this);
            t.StretchAllColumns = true;
            foreach (Fund f in Db.getFunds())
            {
                var tr = new TableRow(this);
                var tdFundName = new TextView(this);
                tdFundName.Text = f.fund_name;
                tdFundName.Tag = f.fund_id;
                tdFundName.Click += Fund_Click;

                tr.AddView(tdFundName);

                var tdAmount = new TextView(this);
                tdAmount.Tag = f.fund_id;
                tdAmount.Click += Fund_Click;
                tdAmount.Text = String.Format("{0:C}", Db.getFundTotal(account_id: account_id, fund_id: f.fund_id));
                tdAmount.Gravity = GravityFlags.Right;
                tr.AddView(tdAmount);

                t.AddView(tr);
            }
            scrollview.AddView(t);
        }
开发者ID:802701ad,项目名称:PennyPincherAndroid,代码行数:31,代码来源:ActivityFundTotalsInAccount.cs

示例2: OnCreate

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

            ScrollView scrollView = new ScrollView(this);

            TableLayout tableLayout = new TableLayout(this);
            TableRow tablerow = new TableRow(this);

            // make columns span the whole width
            tableLayout.SetColumnStretchable(0, true);
            tableLayout.SetColumnStretchable(1, true);

            TextView DepartCollumn = new TextView(this);
            DepartCollumn.Text = "Depart";
            tablerow.AddView(DepartCollumn);
            TimetableList.TimeColumns.Add(DepartCollumn);
            TextView ArriveCollumn = new TextView(this);
            ArriveCollumn.Text = "Arrive";
            tablerow.AddView(ArriveCollumn);
            TimetableList.TimeColumns.Add(ArriveCollumn);

            tableLayout.AddView(tablerow);
            //			tableLayout.SetScrollContainer(true);

            scrollView.AddView(tableLayout);

            SetContentView(scrollView);
        }
开发者ID:MWGNZ,项目名称:Wellington-Trains,代码行数:29,代码来源:TimetableDayActivity.cs

示例3: OnCreate

        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            //set view
            SetContentView(Resource.Layout.SelectView);
            TextView Lab_RowTitle = FindViewById<TextView>(Resource.Id.Lab_RowTitle);
            Lab_RowTitle.Text = "城市";
            //get Data
            //    得到跳转到该Activity的Intent对象
            Bundle bundle = Intent.GetBundleExtra("bundle");
            List<string> citylist = bundle.GetStringArrayList("citylist").ToList();

            //Create your application here
            TableLayout MainTable = FindViewById<TableLayout>(Resource.Id.table_city);
            Button b;
            TableRow tr;
            for (int i = 0; i < citylist.Count; i++)
            {
                tr = new TableRow(this);

                b = new Button(this);
                //string cityname = citylist[i].Substring(1, citylist[i].Length - 2);
                string cityname = citylist[i];
                b.Text = cityname;
                b.Click+= delegate { CreatNewSelect(cityname); };
                tr.AddView(b);

                MainTable.AddView(tr);
            }
        }
开发者ID:Chunshan-Theta,项目名称:Xamarin_WeatherAPP_iOS_Android-,代码行数:30,代码来源:selectcity.cs

示例4: AppendRow

		void AppendRow (TableLayout table)
		{
			TableRow row = new TableRow (this);

			TextView label = new TextView (this);
			label.SetText (Resource.String.table_layout_8_quit);
			label.SetPadding (3, 3, 3, 3);

			TextView shortcut = new TextView (this);
			shortcut.SetText (Resource.String.table_layout_8_ctrlq);
			shortcut.SetPadding (3, 3, 3, 3);
			shortcut.Gravity = GravityFlags.Right | GravityFlags.Top;

			row.AddView (label, new TableRow.LayoutParams (1));
			row.AddView (shortcut, new TableRow.LayoutParams ());

			table.AddView (row, new TableLayout.LayoutParams ());
		}
开发者ID:89sos98,项目名称:monodroid-samples,代码行数:18,代码来源:TableLayout08.cs

示例5: OnCreate

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

			// Create your application here

			var container = new LinearLayout (this) {
				Background=Android.Graphics.Color.Yellow.ToDrawable(),
			};

			SetContentView (container);

			var table = new TableLayout (this) {
				Background=Android.Graphics.Color.Red.ToDrawable(),
				StretchAllColumns=true,		// カラムを均等割にする
				WeightSum=rows,				// 行を均等割にしたいので行数を指定									
			};

			container.AddView (table,
				new LinearLayout.LayoutParams (
					LinearLayout.LayoutParams.MatchParent,	// 幅は親に合わせる
					LinearLayout.LayoutParams.MatchParent)	// 高さは親に合わせる
			);

			for (int i = 0; i < rows; i++) {
				
				var rowlayouts = new TableLayout.LayoutParams (
					TableLayout.LayoutParams.WrapContent,
					TableLayout.LayoutParams.WrapContent)
				{ Weight = 1,	// テーブルの中で均等割するので全ての重みを1にする
					Height=0	// 高さを自動指定
				};

				var row = new TableRow (this);
				table.AddView (row, rowlayouts);

				for (int j = 0; j < cols; j++) {

					var buttonlayout = new TableRow.LayoutParams (
						TableRow.LayoutParams.WrapContent,
						TableRow.LayoutParams.MatchParent	// 高さは行に合わせる
					) {
						Width = 0,			// 幅を自動設定
						RightMargin = 4, 	// 隙間を開ける
						TopMargin = 4		// 隙間を開ける
					};

					var button = new Button (this) {
						Text=$"{i}-{j}",
						Background=Android.Graphics.Color.Blue.ToButtonPressEffect()
					};
					row.AddView (button, buttonlayout);
				}						
			}
		}
开发者ID:hdknr,项目名称:DroidLayout,代码行数:55,代码来源:ButtonTable.cs

示例6: UpdateMemoryTableUI

        private void UpdateMemoryTableUI()
        {
            tlData.RemoveAllViews();
            foreach (var memoryItem in store.Items)
            {
                TableRow tr = new TableRow(this);
                var rowColor = Color.White;
                tr.SetBackgroundColor(rowColor);

                var cellColor = Color.Black;
                var txtVal1 = new TextView(this) {Text = memoryItem.Values[0]};
                txtVal1.SetPadding(1, 1, 1, 1);
                tr.AddView(txtVal1);
                txtVal1.SetBackgroundColor(cellColor);
                var txtVal2 = new TextView(this) {Text = memoryItem.Values[1]};
                txtVal2.SetPadding(1, 1, 1, 1);
                txtVal2.SetBackgroundColor(cellColor);
                tr.AddView(txtVal2);
                tlData.AddView(tr);
            }
        }
开发者ID:nastyaK,项目名称:MemorizeIt,代码行数:21,代码来源:MainActivity.cs

示例7: OnCreate

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

            var tableLayout = new TableLayout(this);
            tableLayout.LayoutParameters = new TableLayout.LayoutParams(
                ViewGroup.LayoutParams.MatchParent,
                ViewGroup.LayoutParams.WrapContent);

            TableRow tableRow1 = new TableRow(this);
            TableRow tableRow2 = new TableRow(this);

            var aTextView1 = new TextView(this);
            aTextView1.Text = "A TextView";

            var aTextView2 = new TextView(this);
            aTextView2.Text = "And another!";

            tableRow1.AddView(aTextView1, 0);
            tableRow1.AddView(aTextView2, 1);


            var aButton1 = new Button(this);
            aButton1.Text = "Click Me!";

            var aButton2 = new Button(this);
            aButton2.Text = "Or Me!";

            tableRow2.AddView(aButton1, 0);
            tableRow2.AddView(aButton2, 1);

            tableLayout.AddView(tableRow1, 0);
            tableLayout.AddView(tableRow2, 1);

            SetContentView(tableLayout);
        }
开发者ID:mhalkovitch,项目名称:Xamarim,代码行数:37,代码来源:TableViewCodeActivity.cs

示例8: Refresh

 public void Refresh()
 {
     hScroll.RemoveAllViews();
     var t = new TableLayout(this);
     foreach (Account a in Db.getAccounts())
     {
         var tr = new TableRow(this);
         var b = new Button(this);
         b.Text = a.account_name;
         b.Tag = a.account_id;
         b.Click += Account_Click;
         tr.AddView(b);
         t.AddView(tr);
     }
     hScroll.AddView(t);
 }
开发者ID:802701ad,项目名称:PennyPincherAndroid,代码行数:16,代码来源:ActivityMain.cs

示例9: PreparePage

        private void PreparePage()
        {
            //status = DialogManager.ShowStatus(this, Database.GetText("Communicating", "System"));
            Core.LiveDataVector vec = Manager.LiveDataVector;
            vec.DeployEnabledIndex();
            vec.DeployShowedIndex();
            RunOnUiThread(() => 
            {
                for (int i = 0; i < vec.ShowedCount; i++)
                {
                    TextView content = new TextView(this);
                    content.Text = StaticString.beforeBlank + vec[vec.ShowedIndex(i)].Content;
                    TextView unit = new TextView(this);
                    unit.Text = vec[vec.ShowedIndex(i)].Unit;
                    TextView value = new TextView(this);
                    value.Text = vec[vec.ShowedIndex(i)].Value;
                    value.SetTextColor(Android.Graphics.Color.DarkBlue);
                    TableRow row = new TableRow(this);
                    row.AddView(content);
                    row.AddView(value);
                    row.AddView(unit);
                    layout.AddView(row);

                    vec[vec.ShowedIndex(i)].PropertyChanged += (sender, e) =>
                    {
                        if (e.PropertyName == "Value")
                        {
                            OnValueChange((Core.LiveData)sender);
                        }
                    };
                }
                status.Dismiss();
            });
        }
开发者ID:Tomic-Tech,项目名称:JM.QingQi,代码行数:34,代码来源:DataStreamActivity.cs

示例10: GetDelim

        TableRow GetDelim(Android.Graphics.Color color)
        {
            TableRow.LayoutParams lpDelim = new TableRow.LayoutParams ();
            lpDelim.Height = TableLayout.LayoutParams.WrapContent;
            lpDelim.Width = TableLayout.LayoutParams.WrapContent;
            lpDelim.SetMargins (ToDIP(2), ToDIP(1), ToDIP(2), ToDIP(1));
            //			lpDelim.Span = currentAttendances.Count + 2;
            lpDelim.Span = newAttendanceResults.Count + 2;

            TableRow rDelim = new TableRow (Activity);
            View vDelim = new View (Activity);
            vDelim.SetMinimumHeight (ToDIP(3));
            vDelim.SetBackgroundColor (color);
            vDelim.LayoutParameters = lpDelim;
            rDelim.AddView (vDelim);

            return rDelim;
        }
开发者ID:pafik13,项目名称:SBL-CRM,代码行数:18,代码来源:DrugInfoFragment.cs

示例11: RefreshTable

        void RefreshTable()
        {
            table.RemoveAllViews ();

            TableRow.LayoutParams lpRow = new TableRow.LayoutParams ();
            lpRow.Height = TableLayout.LayoutParams.WrapContent;
            lpRow.Width = TableLayout.LayoutParams.WrapContent;
            lpRow.Gravity = GravityFlags.Center;

            //header
            TableRow trHeader = new TableRow (Activity);
            TextView tvHDrug = (TextView)layoutInflater.Inflate(Resource.Layout.DrugInfoDrugItem, null);
            //tvHDrug.SetTextAppearance (Activity, Resource.Style.text_header_large);
            tvHDrug.Text = "Препараты";
            tvHDrug.LayoutParameters = lpRow;
            ((TableRow.LayoutParams)tvHDrug.LayoutParameters).SetMargins (0, 0, ToDIP(1) , 0);
            tvHDrug.SetBackgroundColor (Android.Graphics.Color.White);
            trHeader.AddView (tvHDrug);

            int i = 0;

            TableRow.LayoutParams lpValue = new TableRow.LayoutParams ();
            lpValue.Height = TableLayout.LayoutParams.WrapContent;
            lpValue.Width = TableLayout.LayoutParams.WrapContent;
            lpValue.Gravity = GravityFlags.Center;
            lpValue.SetMargins (ToDIP(1), ToDIP(1), ToDIP(1), ToDIP(1));

            foreach (var drug in drugs) {

                i++;

                TableRow trRow = new TableRow (Activity);
                TextView tvDrug = (TextView)layoutInflater.Inflate(Resource.Layout.DrugInfoDrugItem, null);
                tvDrug.Gravity = GravityFlags.CenterVertical;
                tvDrug.SetTextAppearance (Activity, Resource.Style.text_row_large);
                tvDrug.Text = string.Format(@"{0}: {1}", i, drug.fullName);
                tvDrug.LayoutParameters = lpRow;
                tvDrug.SetBackgroundColor (Android.Graphics.Color.White);
                trRow.AddView (tvDrug);

                foreach (var info in infos) {

                    if (trHeader.Parent == null) {
                        TextView tvHInfo = (TextView)layoutInflater.Inflate(Resource.Layout.DrugInfoValueHeader, null);
                        tvHInfo.Text = info.name;
                        tvHInfo.SetBackgroundColor (Android.Graphics.Color.White);
                        trHeader.AddView (tvHInfo);
                    }

                    RelativeLayout rlValue = new RelativeLayout(Activity);
                    rlValue.SetGravity (GravityFlags.Center);
                    rlValue.SetMinimumHeight (ToDIP(64));
                    rlValue.SetMinimumWidth (ToDIP(64));
                    rlValue.LayoutParameters = lpValue;

                    rlValue.SetTag (Resource.String.IDinfo, info.id);
                    rlValue.SetTag (Resource.String.IDdrug, drug.id);
            //					rlValue.SetTag (Resource.String.IDattendance, attendace.id);

                    string value = AttendanceResultManager.GetResultValue (newAttendanceResults, info.id, drug.id);

                    if (info.valueType == @"number") {
                        RelativeLayout.LayoutParams nlpValue = new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.WrapContent, RelativeLayout.LayoutParams.MatchParent);
                        nlpValue.AddRule (LayoutRules.CenterInParent);
                        nlpValue.SetMargins (ToDIP(1), ToDIP(1), ToDIP(1), ToDIP(1));

                        EditText evValue = new EditText (Activity) { LayoutParameters = nlpValue };
                        evValue.SetMinimumWidth (ToDIP(64));
                        evValue.SetMaxWidth (ToDIP(64));
                        evValue.InputType = Android.Text.InputTypes.ClassNumber;
                        evValue.Text = value.Equals (@"N") ? string.Empty : value;
                        rlValue.AddView (evValue);
                        evValue.AfterTextChanged += NumberValue_AfterTextChanged;
                    }

                    if (info.valueType == @"decimal") {
                        RelativeLayout.LayoutParams dlpValue = new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.WrapContent, RelativeLayout.LayoutParams.MatchParent);
                        dlpValue.AddRule (LayoutRules.CenterInParent);
                        dlpValue.SetMargins (ToDIP(1), ToDIP(1), ToDIP(1), ToDIP(1));

                        EditText evValue = new EditText (Activity) { LayoutParameters = dlpValue };
                        evValue.SetMinimumWidth (ToDIP(64));
                        evValue.SetMaxWidth (ToDIP(64));
                        evValue.InputType = Android.Text.InputTypes.NumberFlagDecimal;
                        evValue.Text = value.Equals (@"N") ? string.Empty : value;
                        rlValue.AddView (evValue);
                        evValue.AfterTextChanged += DecimalValue_AfterTextChanged;
                    }

                    if (info.valueType == @"boolean") {
                        rlValue.Click += Rl_Click;

                        TextView tvValue = new TextView (Activity);
                        tvValue.Gravity = GravityFlags.Center;
                        if (string.IsNullOrEmpty (value) || value.Equals (@"N")) {
                            tvValue.SetTextAppearance (Activity, Resource.Style.text_danger);
                            rlValue.SetBackgroundColor (Android.Graphics.Color.LightPink);
                        } else {
                            tvValue.SetTextAppearance (Activity, Resource.Style.text_success);
                            rlValue.SetBackgroundColor (Android.Graphics.Color.LightGreen);
//.........这里部分代码省略.........
开发者ID:pafik13,项目名称:SBL-CRM,代码行数:101,代码来源:DrugInfoFragment.cs

示例12: RefreshTable

        void RefreshTable()
        {
            table.RemoveAllViews ();

            TableRow header = new TableRow (Activity);
            header.SetMinimumHeight (70);
            TableRow.LayoutParams hParamsDrug = new TableRow.LayoutParams ();
            hParamsDrug.Height = TableLayout.LayoutParams.WrapContent;
            hParamsDrug.Width = TableLayout.LayoutParams.WrapContent;
            hParamsDrug.Gravity = GravityFlags.Center;
            //			hParamsDrug.Span = 2;

            TextView hDrug = new TextView (Activity);
            hDrug.Text = @"Препараты";
            hDrug.LayoutParameters = hParamsDrug;
            header.AddView(hDrug);

            TableRow.LayoutParams p = new TableRow.LayoutParams ();
            p.Height = TableLayout.LayoutParams.WrapContent;
            p.Width = TableLayout.LayoutParams.WrapContent;
            p.Gravity = GravityFlags.Center;

            TableLayout tlHeader = new TableLayout (Activity);
            TableRow rAttendance = new TableRow (Activity);

            foreach (var attendace in drugInfo.attendaces) {
                TextView hAttendace = new TextView (Activity);
                hAttendace.Text = attendace.date.ToString(@"dd-MMM ddd");
                hAttendace.LayoutParameters = p;
                hAttendace.Rotation = -60;
                header.AddView (hAttendace);
            //				rAttendance.AddView(hAttendace);
            }
            //			tlHeader.AddView (rAttendance);
            //			header.AddView (tlHeader);
            //			table.AddView(header);

            foreach (var info in infos) {
                TableRow r = new TableRow (Activity);

                TextView v = new TextView (Activity);
                v.Gravity = GravityFlags.Center;
                v.SetSingleLine (false);
                v.SetMinimumHeight (72);
                v.SetMinimumWidth (68);
                v.Rotation = -90;
                //				v.SetBackgroundResource (Resource.Style.text_row);
                //				v.SetB
                //				v.Text = info.infoID.ToString();
                //				v.Text = GetInfo(info.infoID).name;
                //				v.SetHorizontallyScrolling (false);
                v.Text = info.name;
                v.LayoutParameters = p;

                r.AddView (v);

                TableLayout tl = new TableLayout (Activity);
                if (header.Parent == null) {
                    tl.AddView (header);
                }
                tl.Id = info.id;
                foreach (var drug in drugs) {
                    TableRow rr = new TableRow (Activity);
                    rr.Id = drug.id;

                    TextView vv = new TextView (Activity);
                    vv.Gravity = GravityFlags.Center;
                    vv.SetMinimumHeight (42);
                    vv.SetMinimumWidth (76);
                    //					vv.Text = drugInfo.drugID.ToString();
                    //					vv.Text = GetDrug(drugInfo.drugID).fullName;
                    vv.Text = drug.fullName;
                    vv.LayoutParameters = p;
                    rr.AddView (vv);

                    foreach (var attendace in drugInfo.attendaces) {
                        RelativeLayout rl = new RelativeLayout(Activity);
                        rl.SetGravity (GravityFlags.Center);
                        rl.SetMinimumHeight (68);
                        rl.SetMinimumWidth (68);
                        rl.LayoutParameters = p;
                        rl.Id = attendace.id;
                        rl.Click += (object sender, EventArgs e) => {
                            RelativeLayout rlAttendace = (RelativeLayout) sender;
                            TableRow trDrug = (TableRow) rl.Parent;
                            TableLayout trInfo = (TableLayout) rl.Parent.Parent;

                            string message = string.Format(@"Click to RL.id:{0}, P,id:{1}, PP.id:{2}", rlAttendace.Id, trDrug.Id, trInfo.Id);

                            Toast.MakeText(Activity,  message, ToastLength.Short).Show();

                            FragmentTransaction trans = FragmentManager.BeginTransaction ();
                            DrugInfoValueDialog drugInfoValueDialog = new DrugInfoValueDialog ();
                            Bundle args = new Bundle();
                            args.PutInt(DrugInfoValueDialog.ATTENDANCE_ID, rlAttendace.Id);
                            args.PutInt(DrugInfoValueDialog.DRUG_ID, trDrug.Id);
                            args.PutInt(DrugInfoValueDialog.INFO_ID, trInfo.Id);
            //							args.PutString(DrugInfoValueDialog.VALUE, GetDrugInfoValue(drugInfo.attendaces[rlAttendace.Id - 1].results, trInfo.Id, trDrug.Id));

                            drugInfoValueDialog.Arguments = args;
//.........这里部分代码省略.........
开发者ID:pafik13,项目名称:pharm-merch-tablet,代码行数:101,代码来源:MainFragment+-+копия.cs

示例13: RefreshPharmacyTable

        void RefreshPharmacyTable()
        {
            pharamcyTable.Visibility = ViewStates.Visible;

            //Add Header Row
            TableRow hRow = new TableRow (this);
            hRow.SetBackgroundResource(Resource.Drawable.bottomline);

            TextView hID = GetHeadItem (ColumnPosition.cpFirst);
            hID.Gravity = GravityFlags.Center;
            hID.Text = @"ID";
            hRow.AddView (hID);

            TextView hShortName = GetHeadItem (ColumnPosition.cpMiddle);
            hShortName.Gravity = GravityFlags.CenterVertical;
            hShortName.Text = @"Аптека";
            hRow.AddView (hShortName);

            TextView hTradeNet = GetHeadItem (ColumnPosition.cpMiddle);
            hTradeNet.Gravity = GravityFlags.CenterVertical;
            hTradeNet.Text = @"Сеть";
            hRow.AddView (hTradeNet);

            TextView hAddress = GetHeadItem (ColumnPosition.cpMiddle);
            hAddress.Gravity = GravityFlags.CenterVertical;
            hAddress.Text = @"Адрес";
            hRow.AddView (hAddress);

            TextView hWeekM2 = GetHeadItem (ColumnPosition.cpMiddle);
            hWeekM2.Gravity = GravityFlags.CenterVertical;
            hWeekM2.Text = @"Неделя -2";
            hRow.AddView (hWeekM2);

            TextView hWeekM1 = GetHeadItem (ColumnPosition.cpMiddle);
            hWeekM1.Gravity = GravityFlags.CenterVertical;
            hWeekM1.Text = @"Неделя -1";
            hRow.AddView (hWeekM1);

            TextView hWeek = GetHeadItem (ColumnPosition.cpMiddle);
            hWeek.Gravity = GravityFlags.CenterVertical;
            hWeek.Text = @"Текущ. неделя";
            hRow.AddView (hWeek);

            TextView hWeekP1 = GetHeadItem (ColumnPosition.cpMiddle);
            hWeekP1.Gravity = GravityFlags.CenterVertical;
            hWeekP1.Text = @"Неделя +1";
            hRow.AddView (hWeekP1);

            TextView hWeekP2 = GetHeadItem (ColumnPosition.cpLast);
            hWeekP2.Gravity = GravityFlags.CenterVertical;
            hWeekP2.Text = @"Неделя +2";
            hRow.AddView (hWeekP2);

            pharamcyTable.AddView(hRow);

            // Content
            if (pharamcyTable != null) {
                int childCount = pharamcyTable.ChildCount;

                // Remove all rows except the first one
                if (childCount > 1) {
                    pharamcyTable.RemoveViews(1, childCount - 1);
                }

                pageNum.Text = string.Format(@"СТРАНИЦА : {0}", page);
                var pharmacies = (from pharm in PharmacyManager.GetPharmacies(string.Empty)
                               orderby pharm.next, pharm.id
                                select pharm).Skip((page - 1) * itemsNum)
                                             .Take(itemsNum);

                var tradenets = Common.GetTradeNets (user.username);
                Dictionary <int, string> tnDict = new Dictionary<int, string> ();
                foreach (var item in tradenets) {
                    tnDict.Add (item.id, item.shortName);
                };

                foreach (var pharmacy in pharmacies) {
                    TableRow cRow = new TableRow (this);
                    if (pharmacy.prev.Date == DateTime.Now.Date) {
                        cRow.SetBackgroundResource (Resource.Drawable.bottomline_green);
                    } else if (pharmacy.next.Date < DateTime.Now.Date && pharmacy.prev != DateTime.MinValue) {
                        cRow.SetBackgroundResource (Resource.Drawable.bottomline_red);
                    } else {
                        cRow.SetBackgroundResource (Resource.Drawable.bottomline);
                    }

                    TextView id = GetItem(ColumnPosition.cpFirst);
                    id.Gravity = GravityFlags.Center;
                    id.Text = pharmacy.id.ToString ();
                    cRow.AddView (id);

                    TextView shortName = GetItem(ColumnPosition.cpMiddle);
                    shortName.Gravity = GravityFlags.CenterVertical;
                    shortName.Text = pharmacy.shortName;
                    shortName.SetSingleLine (true);
                    shortName.Ellipsize = Android.Text.TextUtils.TruncateAt.End;
                    cRow.AddView (shortName);

                    TextView tradeNet = GetItem(ColumnPosition.cpMiddle);
                    tradeNet.Gravity = GravityFlags.CenterVertical;
//.........这里部分代码省略.........
开发者ID:pafik13,项目名称:SBL-CRM,代码行数:101,代码来源:MainActivity.cs

示例14: createItem

 private View createItem(Context context, int width, Events ev)
 {
     TableRow row = new TableRow(context);
     row.SetVerticalGravity(GravityFlags.CenterVertical);
     int rowWidth = (width / 10);
     if (ev.IsHeader)
         row.AddView(createHeader(context,ev),rowWidth*10,50);
     else if (ev.Type == "PAA" || ev.Type == "ELASH")
     {
         row.AddView(createColumn(context, ev.Date), rowWidth * 8, 40);
         row.AddView(createHour(context, ev.Hour), rowWidth * 2, 40);
     }
     else
     {
         row.AddView(createDoubleColumn(context, ev.Event,ev.Date), rowWidth * 8, 80);
         if (ev.Type == "PREU")
             row.AddView(createDoubleHour(context, ev.Hour), rowWidth * 2, 80);
         else
             row.AddView(createHour(context, ev.Hour), rowWidth * 2, 80);
     }
     return row;
 }
开发者ID:sanjisama,项目名称:UPBCalendar,代码行数:22,代码来源:EventAdapter.cs

示例15: CreateRow

		private static TableRow CreateRow (Context context, View leftTextView, View rightTextView, GridLength leftColumnWidth, GridLength rightColumnWidth)
		{
			var tableRow = new TableRow (context);
			var linearLayout = new LinearLayout (context) { WeightSum = (float)1.0 };

			//This is a little counter intuitive, but the Left Text View needs to be set to the Right Column Width 
			var leftTextViewLayout = new LinearLayout.LayoutParams (ViewGroup.LayoutParams.MatchParent,
				                            ViewGroup.LayoutParams.MatchParent) { Weight = (float)rightColumnWidth.Value };

			leftTextView.LayoutParameters = leftTextViewLayout;
      
			linearLayout.AddView (leftTextView);

			var rightTextViewLayout = new LinearLayout.LayoutParams (ViewGroup.LayoutParams.MatchParent,
				                             ViewGroup.LayoutParams.MatchParent) { Weight = (float)leftColumnWidth.Value };

			rightTextView.LayoutParameters = rightTextViewLayout;
      
			linearLayout.AddView (rightTextView);
      
			tableRow.AddView (linearLayout);

			return tableRow;
		}
开发者ID:patridge,项目名称:Xamarin.Forms.Plugins,代码行数:24,代码来源:ExtendedTextCellRenderer.cs


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