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

C# Views.ViewGroup类代码示例

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

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



ViewGroup类属于Android.Views命名空间,在下文中一共展示了ViewGroup类的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: GetView

        public override View GetView(Context context, View convertView, ViewGroup parent)
		{
            this.Click = delegate { SelectImage(); };

            Bitmap scaledBitmap = Bitmap.CreateScaledBitmap(_image, dimx, dimy, true);

            var view = convertView as RelativeLayout;
            if (view == null)
            {
                view = new RelativeLayout(context);
                _imageView = new ImageView(context);
            }
            else
            {
                _imageView = (ImageView)view.GetChildAt(0);
            }
            _imageView.SetImageBitmap(scaledBitmap);
            
            var parms = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);
            parms.SetMargins(5, 2, 5, 2);
            parms.AddRule( LayoutRules.AlignParentLeft);
			if(_imageView.Parent != null && _imageView.Parent is ViewGroup)
				((ViewGroup)_imageView.Parent).RemoveView(_imageView);
			view.AddView(_imageView, parms);

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


示例3: OnCreateView

		public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			// Use this to return your custom view for this Fragment
			// return inflater.Inflate(Resource.Layout.YourFragment, container, false);

			//	  Lich hoc theo HK
			var rootView = inflater.Inflate (Resource.Layout.LichHoc_HK, container, false);
			isfirst = true;
			listView_HK = rootView.FindViewById<ListView> (Resource.Id.listLH);
			lbl_HK = rootView.FindViewById<TextView> (Resource.Id.lbl_HK_LH);
			lbl_NH = rootView.FindViewById<TextView> (Resource.Id.lbl_NH_LH);
			progress = rootView.FindViewById<ProgressBar> (Resource.Id.progressLH);
			linear = rootView.FindViewById<LinearLayout>(Resource.Id.linear_HK_LH);
			linearLH = rootView.FindViewById<LinearLayout>(Resource.Id.linearLH);
			txtNotify = rootView.FindViewById<TextView>(Resource.Id.txtNotify_LT_HK);
		//	radioGroup = rootView.FindViewById<RadioGroup>(Resource.Id.radioGroup1);
		    bundle=this.Arguments;
			check = bundle.GetBoolean ("Remind");
			autoupdate = bundle.GetBoolean ("AutoUpdateData");

			//load data

			LoadData_HK ();
		
			// row click
			listView_HK.ItemLongClick += listView_ItemClick;
						

			return rootView;
		}
开发者ID:tienbui123,项目名称:Mobile-VS2,代码行数:30,代码来源:LichHocHKFragment.cs


示例4: OnCreateView

		public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			if (container == null) {
				// Currently in a layout without a container, so no reason to create our view.
				return null;
			}

			var view = inflater.Inflate(Resource.Layout.speaker_screen, container, false);

			var speaker = EvolveData.SpeakerData [ShownSpeakerIndex];

			headshotImageView = view.FindViewById<ImageView> (Resource.Id.headshotImageView);
			var headshot = GetHeadShot (speaker.HeadshotUrl);
			headshotImageView.SetImageDrawable (headshot);

			speakerNameTextView = view.FindViewById<TextView> (Resource.Id.speakerNameTextView);
			speakerNameTextView.Text = speaker.Name;

			companyNameTextView = view.FindViewById<TextView> (Resource.Id.companyNameTextView);
			companyNameTextView.Text = speaker.Company;

			twitterHandleView = view.FindViewById<TextView> (Resource.Id.twitterTextView);
			twitterHandleView.Text = "@" + speaker.TwitterHandle;

			return view;
		}
开发者ID:ctsxamarintraining,项目名称:Xamarin,代码行数:26,代码来源:SpeakerDetailsFragment.cs


示例5: OnCreateView

		public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			// Use this to return your custom view for this Fragment
			var view = inflater.Inflate(Resource.Layout.HeaderFragmentLayout, container, false);
			var homeBtn = view.FindViewById<ImageView>(Resource.Id.HeaderLogo);
			var overlayBtn = view.FindViewById<ImageView>(Resource.Id.HeaderOverlay);
			var animIn = AnimationUtils.LoadAnimation(Activity.BaseContext, Resource.Animation.Overlay_animIn);

			homeBtn.Click += delegate
			{
				if (!(Activity is MainActivity))
				{
					var i = new Intent(Activity, typeof(MainActivity));
					i.AddFlags(ActivityFlags.NewTask | ActivityFlags.ClearTop);
					Activity.StartActivity(i);
				}
			};

			overlayBtn.Click += delegate
			{
				overlay.View.StartAnimation(animIn);
				overlay.Initialize();
				overlay.View.Visibility = ViewStates.Visible;
			};

			return view;
		}
开发者ID:JMHornberg,项目名称:PJ6000-Hovedprosjekt,代码行数:27,代码来源:HeaderFragment.cs


示例6: OnCreateView

 public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
 {
     var view = inflater.Inflate(Resource.Layout.BusinessCardFragmentLayout, container, false);
     var listView = view.FindViewById<ListView>(Resource.Id.listViewBusinessCards);
     listView.Adapter = new BusinessCardAdapter (this.Activity);
     return view;
 }
开发者ID:aaronlab,项目名称:Xamarin-Framework-Samples,代码行数:7,代码来源:BusinessCardFragment.cs


示例7: OnCreateViewHolder

		public override RecyclerView.ViewHolder OnCreateViewHolder (ViewGroup parent, int viewType)
		{	

			View v = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.inflator_layout2,parent,false);
			var vh = new MyViewHolder2(v);
			return vh;
		} 
开发者ID:kamalthakur2305,项目名称:Xamarin-Multiple-RecyclerView,代码行数:7,代码来源:MyAdapter2.cs


示例8: OnCreateView

		public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			// Use this to return your custom view for this Fragment
			// return inflater.Inflate(Resource.Layout.YourFragment, container, false);
		
//  Lich hoc theo HK
//		    var rootView = inflater.Inflate(Resource.Layout.LichHoc_HK, container, false);
//			ListView listView = rootView.FindViewById<ListView>(Resource.Id.listLH);
//
//			var t= BLichHoc.MakeDataFromXml(SQLite_Android.GetConnection ());
//			List<LichHoc> listLH = BLichHoc.GetAll (SQLite_Android.GetConnection ());
//			List<chiTietLH> listCT = new List<chiTietLH> ();
//			foreach (var item in listLH) {
//				listCT.AddRange(BLichHoc.GetCTLH (SQLite_Android.GetConnection (), item.Id));
//
//			}
//	
//
//			LichHocHKAdapter adapter = new LichHocHKAdapter (Activity, listCT);
//			listView.Adapter  = adapter;


			//Theo Tuan
			var rootView = inflater.Inflate(Resource.Layout.LichHoc_Tuan, container, false);
			listView = rootView.FindViewById<ExpandableListView>(Resource.Id.listLH_Tuan);
			progress=rootView.FindViewById<ProgressBar>(Resource.Id.progressLHTuan);


			LoadData ();

		
			return rootView;
		}
开发者ID:tienbui123,项目名称:School-App-Mobile,代码行数:33,代码来源:LichHocFragment.cs


示例9: CustomInfoWindow

		public CustomInfoWindow (Context context, ViewGroup viewGroup, List<CustomPin> pins)
		{
			_context = context;
			_viewGroup = viewGroup;
			_pins = pins;

		}
开发者ID:biyyalakamal,项目名称:customer-success-samples,代码行数:7,代码来源:CustomInfoWindow.cs


示例10: OnCreateView

		public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			View v = inflater.Inflate (Resource.Layout.WebViewDialog, container, false);

			txtTitle = v.FindViewById<TextView> (Resource.Id.txt_dialog_title);
			divider = v.FindViewById<View> (Resource.Id.title_divider);
			webView = v.FindViewById<WebView> (Resource.Id.dialog_web_view);

			if (title == null || title.Length < 1) {
				txtTitle.Visibility = divider.Visibility = ViewStates.Gone;
			} else {
				txtTitle.Text = title;
			}

			if (url != null && url.Length > 0) {
				webView.LoadUrl (url);
			}

			if (showOkay) {
				btnOk.Visibility = ViewStates.Visible;
				btnOk.Click += (object sender, EventArgs e) => {
					this.Dismiss ();
				};
			}

			return v;
		}
开发者ID:KiranKumarAlugonda,项目名称:TXTSHD,代码行数:27,代码来源:WebViewDialog.cs


示例11: GetView

		public override View GetView (Context context, View convertView, ViewGroup parent)
		{
			var view = new RelativeLayout(context);
						
            var parms = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent,
                                                        ViewGroup.LayoutParams.WrapContent);

            view.SetMinimumHeight(150);
            parms.SetMargins(5, 3, 5, 0);
            parms.AddRule(LayoutRules.AlignParentLeft);

			_caption = new TextView (context);
			SetCaption (Caption);
            view.AddView(_caption, parms);
			
			if (!String.IsNullOrWhiteSpace (Indicator)) {
	            var tparms = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent,
	                                                         ViewGroup.LayoutParams.WrapContent);
	            tparms.SetMargins(5, 3, 5, 5);
	            tparms.AddRule(LayoutRules.CenterVertical);
				tparms.AddRule(LayoutRules.AlignParentRight);
	
	            _text = new TextView (context) {
					Text = Indicator,
					TextSize = 22f
				};
	            view.AddView(_text, tparms);
			}
			return view;
		}
开发者ID:couchbaselabs,项目名称:Andr.Unit,代码行数:30,代码来源:FormattedElement.cs


示例12: GetChildView

		public override View GetChildView(int groupPosition, int childPosition, bool isLastChild, View convertView, ViewGroup parent) {
			View container = View.Inflate(parent.Context, Resource.Layout.list_item_child, null);
			TextView txtGroupName = (TextView)container.FindViewById(Resource.Id.txtExampleName);
			ExampleFragment child = (ExampleFragment)this.GetChild(groupPosition, childPosition);
			txtGroupName.Text = child.Title();
			return container;
		}
开发者ID:bmccool,项目名称:Android-samples,代码行数:7,代码来源:ExamplesAdapter.cs


示例13: GetView

        public override Android.Views.View GetView(int position, Android.Views.View convertView, ViewGroup parent)
        {
            ViewHolder holder;

            if (convertView == null)
            {
                convertView = inflater.Inflate(Resource.Layout.PostItem, parent, false);
                holder = new ViewHolder();

                
                holder.avatar = (ImageView)convertView
                    .FindViewById(Resource.Id.user_photo);
                holder.userNick = (TextView)convertView
                        .FindViewById(Resource.Id.user_nick);
                holder.postDate = (TextView)convertView
                        .FindViewById(Resource.Id.post_date);
                holder.postContent = (TextView)convertView
                        .FindViewById(Resource.Id.post_content);
                
                convertView.SetTag(Resource.String.view_holder_tag, holder);
            }

            else 
            {
                holder = (ViewHolder)convertView.GetTag(Resource.String.view_holder_tag);
            }

            Post postAtPosition = posts[position];
            holder.postContent.Text = postAtPosition.content;
            holder.userNick.Text = postAtPosition.userName;
            holder.postDate.Text = HttpUtils.postDateToShowFormat(postAtPosition.updatedAt);
            Color backgroundColor = postAtPosition.marked ? context.Resources.GetColor(Resource.Color.post_selected) : context.Resources.GetColor(Resource.Color.post_idle);
            convertView.SetBackgroundColor(backgroundColor);
            return convertView;
        }
开发者ID:paulombcosta,项目名称:mono-mobilis,代码行数:35,代码来源:PostAdapter.cs


示例14: OnCreateView

		public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
			view = inflater.Inflate(Resource.Layout.TeamsFragment, container, false);
			if(listTeams.Count == 0) {
				//display text that there are currently no events and hide list with events
				view.FindViewById(Resource.Id.teamsFragmentListTeams).Visibility = ViewStates.Gone;
			} else {
				//display list with events and hide the text
				view.FindViewById(Resource.Id.teamsFragmentNoTeams).Visibility = ViewStates.Gone;

				listView = view.FindViewById<ListView>(Resource.Id.teamsFragmentListTeams);
				listView.Adapter = new ListTeamsAdapter(this, listTeams);
				listView.ItemClick += OnListItemClick;
			}

			if(DB_Communicator.getInstance().isAtLeast(VBUser.GetUserFromPreferences().getUserType(), UserType.Coremember)) {
				view.FindViewById<LinearLayout>(Resource.Id.teamsFragmentBtnAddLine).Visibility = ViewStates.Visible;
			} else {
				view.FindViewById<LinearLayout>(Resource.Id.teamsFragmentBtnAddLine).Visibility = ViewStates.Gone;
			}

			view.FindViewById<Button>(Resource.Id.teamsFragmentBtnAdd).Click += (object sender, EventArgs e) => {
				ViewController.getInstance().mainActivity.switchFragment(ViewController.TEAMS_FRAGMENT, 
					ViewController.ADD_TEAM_FRAGMENT, new AddTeamFragment());
			};

			return view;
		}
开发者ID:Tucaen,项目名称:Karlsfeld-Volleyball-App,代码行数:27,代码来源:TeamsFragment.cs


示例15: OnCreateView

	        public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle p2)
			{
				var v = inflater.Inflate(Resource.Layout.hello_world, container, false);
	            var tv = v.FindViewById<TextView>(Resource.Id.text);
	            tv.Text = "This is an instance of MyDialogFragment";
	            return v;
			}
开发者ID:89sos98,项目名称:monodroid-samples,代码行数:7,代码来源:FragmentDialogOrActivitySupport.cs


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


示例17: GetCellCore

		protected override AView GetCellCore(Cell item, AView convertView, ViewGroup parent, Context context)
		{
			Performance.Start();
			var cell = (ViewCell)item;

			var container = convertView as ViewCellContainer;
			if (container != null)
			{
				container.Update(cell);
				Performance.Stop();
				return container;
			}

			BindableProperty unevenRows = null, rowHeight = null;
			if (ParentView is TableView)
			{
				unevenRows = TableView.HasUnevenRowsProperty;
				rowHeight = TableView.RowHeightProperty;
			}
			else if (ParentView is ListView)
			{
				unevenRows = ListView.HasUnevenRowsProperty;
				rowHeight = ListView.RowHeightProperty;
			}

			IVisualElementRenderer view = Platform.CreateRenderer(cell.View);
			Platform.SetRenderer(cell.View, view);
			cell.View.IsPlatformEnabled = true;
			var c = new ViewCellContainer(context, view, cell, ParentView, unevenRows, rowHeight);

			Performance.Stop();

			return c;
		}
开发者ID:cosullivan,项目名称:Xamarin.Forms,代码行数:34,代码来源:ViewCellRenderer.cs


示例18: OnCreateView

		public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			RadCalendarView calendarView = new RadCalendarView (Activity);
			calendarView.CustomizationRule = new DisabledDatesRule (calendarView.Calendar);

			return calendarView;
		}
开发者ID:bmccool,项目名称:Android-samples,代码行数:7,代码来源:SelectionDisabledDatesFragment.cs


示例19: Create

        public static MonthView Create(ViewGroup parent, LayoutInflater inflater, string weekdayNameFormat,
            DateTime today, ClickHandler handler, int dividerColor, int dayBackgroundResId,
            int dayTextColorResId, int titleTextColor, int headerTextColor)
        {
            var view = (MonthView) inflater.Inflate(Resource.Layout.month, parent, false);
            view.setDividerColor(dividerColor);
            view.setDayTextColor(dayTextColorResId);
            view.setTitleTextColor(titleTextColor);
            view.setHeaderTextColor(headerTextColor);

            if (dayBackgroundResId != 0) {
                view.setDayBackground(dayBackgroundResId);
            }

            var originalDay = today;

            var firstDayOfWeek = (int) CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek;

            var headerRow = (CalendarRowView) view._grid.GetChildAt(0);

            for (int i = 0; i < 7; i++) {
                var offset = firstDayOfWeek - (int) today.DayOfWeek + i;
                today = today.AddDays(offset);
                var textView = (TextView) headerRow.GetChildAt(i);
                textView.Text = today.ToString(weekdayNameFormat);
                today = originalDay;
            }
            view._clickHandler = handler;
            return view;
        }
开发者ID:zhiningliang,项目名称:MonoDroid.TimesSquare,代码行数:30,代码来源:MonthView.cs


示例20: OnCreateView

        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            return inflater.Inflate(Resource.Layout.TestFragment, container, false);

            return base.OnCreateView(inflater, container, savedInstanceState);
        }
开发者ID:Supermortal,项目名称:MaterialDesignSandbox,代码行数:7,代码来源:TestFragment.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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