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


C# LayoutInflater.Inflate方法代码示例

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


在下文中一共展示了LayoutInflater.Inflate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: OnCreateView

		public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			// Open an instance of the first camera and retrieve its info.
			camera = GetCameraInstance (CAMERA_ID);
			Camera.CameraInfo cameraInfo = null;

			if (camera != null) {
				// Get camera info only if the camera is available
				cameraInfo = new Camera.CameraInfo ();
				Camera.GetCameraInfo (CAMERA_ID, cameraInfo);
			}

			if (camera == null || cameraInfo == null) {
				Toast.MakeText (Activity, "Camera is not available.", ToastLength.Short).Show ();
				return inflater.Inflate (Resource.Layout.fragment_camera_unavailable, null);
			}

			View root = inflater.Inflate (Resource.Layout.fragment_camera, null);

			// Get the rotation of the screen to adjust the preview image accordingly.
			SurfaceOrientation displayRotation = Activity.WindowManager.DefaultDisplay.Rotation;

			// Create the Preview view and set it as the content of this Activity.
			cameraPreview = new CameraPreview (Activity, camera, cameraInfo, displayRotation);
			var preview =  root.FindViewById <FrameLayout> (Resource.Id.camera_preview);
			preview.AddView (cameraPreview);

			return root;
		}
开发者ID:Appercode,项目名称:monodroid-samples,代码行数:29,代码来源:CameraPreviewFragment.cs

示例3: OnCreateView

        public override View OnCreateView(LayoutInflater p0, ViewGroup p1, Bundle p2)
        {
            var v = p0.Inflate(Resource.Layout.fragment_test, p1, false);
            m_StickyList = v.FindViewById<StickyListHeadersListView>(Resource.Id.list);
            m_StickyList.OnItemClickListener = this;
            m_StickyList.OnHeaderListClickListener = this;
            m_StickyList.AddHeaderView(p0.Inflate(Resource.Layout.list_header, null));
            m_StickyList.AddFooterView(p0.Inflate(Resource.Layout.list_footer, null));

            m_Adapter = new TestBaseAdapter(Activity);
            m_StickyList.EmptyView = v.FindViewById(Resource.Id.empty);
            m_StickyList.Adapter = m_Adapter;
            return v;
        }
开发者ID:pacificIT,项目名称:XamDroid.StickyListHeaders,代码行数:14,代码来源:TestFragment.cs

示例4: OnCreateView

        public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate (Resource.Layout.FeedbackFragment, container, false);
            feedbackPositiveButton = view.FindViewById<ImageButton> (Resource.Id.FeedbackPositiveButton);
            feedbackNeutralButton = view.FindViewById<ImageButton> (Resource.Id.FeedbackNeutralButton);
            feedbackNegativeButton = view.FindViewById<ImageButton> (Resource.Id.FeedbackNegativeButton);

            feedbackPositiveButton.Click += (sender, e) => SetRating (ratingPositive);
            feedbackNeutralButton.Click += (sender, e) => SetRating (ratingNeutral);
            feedbackNegativeButton.Click += (sender, e) => SetRating (ratingNegative);

            feedbackMessageEditText = view.FindViewById<EditText> (Resource.Id.FeedbackMessageText).SetFont (Font.Roboto);
            feedbackMessageEditText.AfterTextChanged += OnEdit;

            submitFeedbackButton = view.FindViewById<Button> (Resource.Id.SendFeedbackButton).SetFont (Font.Roboto);
            submitFeedbackButton.Click += OnSendClick;

            feedbackContainer = view.FindViewById<LinearLayout> (Resource.Id.FeedbackContainer);
            disclaimerContainer = view.FindViewById<LinearLayout> (Resource.Id.FeedbackDisclaimer);
            noUserRegisterButton = view.FindViewById<Button> (Resource.Id.FeedbackRegisterButton);

            bool offline = ServiceContainer.Resolve<AuthManager> ().OfflineMode;
            disclaimerContainer.Visibility = offline ? ViewStates.Visible : ViewStates.Gone;
            feedbackContainer.Visibility = offline ? ViewStates.Gone : ViewStates.Visible;

            noUserRegisterButton.Click += OpenRegisterScreen;

            SetRating (userRating);

            return view;
        }
开发者ID:eatskolnikov,项目名称:mobile,代码行数:31,代码来源:FeedbackFragment.cs

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

示例6: OnCreateView

        /// <inheritdoc/>
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            ZTnTrace.Trace(MethodBase.GetCurrentMethod());

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

            var careerListView = view.FindViewById<ListView>(Resource.Id.AccountsListView);
            careerListView.ItemClick += (sender, args) =>
            {
                var viewCareerIntent = new Intent(Activity, typeof(ViewCareerActivity));
                D3Context.Instance.BattleTag = args.View.FindViewById<TextView>(Android.Resource.Id.Text1)
                    .Text;
                D3Context.Instance.Host = args.View.FindViewById<TextView>(Android.Resource.Id.Text2)
                    .Text;
                StartActivity(viewCareerIntent);
            };

            D3Context.Instance.DbAccounts = new AccountsDB(Activity);
            cursor = D3Context.Instance.DbAccounts.GetAccounts();
            Activity.StartManagingCursor(cursor);

            IListAdapter accountsAdapter = new SimpleCursorAdapter(Activity, Android.Resource.Layout.SimpleListItem2, cursor, accountsFromColumns, accountsToId);
            view.FindViewById<ListView>(Resource.Id.AccountsListView)
                .Adapter = accountsAdapter;

            return view;
        }
开发者ID:djtms,项目名称:D3-Android-by-ZTn,代码行数:28,代码来源:CareersListFragment.cs

示例7: 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);
            View view = inflater.Inflate(Resource.Layout.HomeFragmentLayout, container, false);
            ImageButton button112 = view.FindViewById<ImageButton>(Resource.Id.imageButton112);
            ImageButton button115 = view.FindViewById<ImageButton>(Resource.Id.imageButton115);
            ImageButton button1515 = view.FindViewById<ImageButton>(Resource.Id.imageButton1515);
            ImageButton button118 = view.FindViewById<ImageButton>(Resource.Id.imageButton118);

            button112.Click+= delegate {
                ClickButton("112");
            };
            button115.Click+= delegate {
                ClickButton("115");
            };
            button1515.Click+= delegate {
                ClickButton("1515");
            };
            button118.Click+= delegate {
                ClickButton("118");
            };

            return view;
        }
开发者ID:KTsolev,项目名称:Emergency_App_V2,代码行数:25,代码来源:HomeFragment.cs

示例8: OnCreateView

        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            RelativeLayout view = (RelativeLayout)inflater.Inflate (Resource.Layout.raffledetail_gettemppass, container, false);
            rootview = view;

            TextView hinttextview=(TextView)view.FindViewById (Resource.Id.gettemppass_hinttext_textview);
            hinttextview.Text = RequestTPScreenData.ProvideClientInfoTextViewText;

            emailorphone = (EditText)view.FindViewById (Resource.Id.gettemppass_emailorphone_edittext);
            emailorphone.Hint = RequestTPScreenData.ClientInfoTextFieldPlaceholder;

            requesttemppass = (Button)view.FindViewById (Resource.Id.gettemppass_requesttemppass_button);
            requesttemppass.Text = RequestTPScreenData.RequestTPBtnTitle;
            //send web request
            requesttemppass.Click+=OnRequestTempPassClick;

            TextView signuptextview=view.FindViewById<TextView> (Resource.Id.gettemppass_register_textview);
            nn_activity.SetClickAbleText (signuptextview,RequestTPScreenData.DontHaveAccountLabelText+RequestTPScreenData.SignUpBtnTitle,RequestTPScreenData.SignUpBtnTitle,()=>{

                if(FormatManager.chechinput(emailorphone.Text,FormatManager.FormatOption.Email)){
                    (nn_activity as HomeScreen).ShowBuyerSignUp(emailorphone.Text);
                }
                else{
                    (nn_activity as HomeScreen).ShowBuyerSignUp("");
                }

            });

            return view;
        }
开发者ID:MADMUC,项目名称:TAP5050,代码行数:30,代码来源:RaffleGetTempPassFragment.cs

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

示例10: OnCreateView

		public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			Dialog.SetTitle (GetString (Resource.String.sign_in));
			var v = inflater.Inflate (Resource.Layout.fingerprint_dialog_container, container, false);
			mCancelButton = (Button)v.FindViewById (Resource.Id.cancel_button);
			mCancelButton.Click += (object sender, EventArgs e) => Dismiss ();

			mSecondDialogButton = (Button)v.FindViewById (Resource.Id.second_dialog_button);
			mSecondDialogButton.Click += (object sender, EventArgs e) => {
				if (mStage == Stage.Fingerprint) {
					GoToBackup ();
				} else {
					VerifyPassword ();
				}
			};

			mFingerprintContent = v.FindViewById (Resource.Id.fingerprint_container);
			mBackupContent = v.FindViewById (Resource.Id.backup_container);
			mPassword = v.FindViewById<EditText> (Resource.Id.password);
			mPassword.SetOnEditorActionListener (this);
			mPasswordDescriptionTextView = v.FindViewById<TextView> (Resource.Id.password_description);
			mUseFingerprintFutureCheckBox = v.FindViewById<CheckBox> (Resource.Id.use_fingerprint_in_future_check);
			mNewFingerprintEnrolledTextView = v.FindViewById<TextView> (Resource.Id.new_fingerprint_enrolled_description);
			mFingerprintUiHelper = mFingerprintUiHelperBuilder.Build (
				(ImageView)v.FindViewById (Resource.Id.fingerprint_icon),
				(TextView)v.FindViewById (Resource.Id.fingerprint_status), this);
			UpdateStage ();

			// If fingerprint authentication is not available, switch immediately to the backup
			// (password) screen.
			if (!mFingerprintUiHelper.IsFingerprintAuthAvailable)
				GoToBackup ();

			return v;
		}
开发者ID:nick30935n,项目名称:monodroid-samples,代码行数:35,代码来源:FingerprintAuthenticationDialogFragment.cs

示例11: OnCreateView

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


			SwipeRefreshLayout = (SwipeRefreshLayout)view.FindViewById(Resource.Id.swipe_refresh_layout);
			SwipeRefreshLayout.SetColorSchemeColors(Resource.Color.tenBlue,
				Resource.Color.colorPrimary,
				Resource.Color.colorAccent,
				Resource.Color.colorPrimaryDark);
			SwipeRefreshLayout.Refresh += async delegate
			{
				await FetchTableData();
			};


			ListView = view.FindViewById<ListView>(Resource.Id.list);
			ListView.SetOnScrollListener(new TailFetchListViewListener(this));
			ListView.AddFooterView(FooterView, null, false);
			ListView.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) =>
			{
				TenServiceHelper.GoToGuestProfile(FragmentManager, Master.Id, TableItems[e.Position]);
			};


			BackgroundTextView = (TextView)view.FindViewById<TextView>(Resource.Id.backgroundTextView);
			BackgroundTextView.Text = EmptyTableString;
			return view;
		}
开发者ID:natevarghese,项目名称:XamarinTen,代码行数:29,代码来源:ListOfFeedFragment.cs

示例12: OnCreateView

 public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
 {
     int layout_resid;
     switch(mPage)
     {
         default:
         case 0:
             layout_resid = Resource.Layout.intro_screen1;
             break;
         case 1:
             layout_resid = Resource.Layout.intro_screen2;
             break;
         case 2:
             layout_resid = Resource.Layout.intro_screen3;
             break;
         case 3:
             layout_resid = Resource.Layout.intro_screen4;
             break;
         case 4:
             layout_resid = Resource.Layout.intro_screen5;
             break;
     }
     View view = inflater.Inflate(layout_resid, container, false);
     view.Tag =  mPage ;
     return view;
 }
开发者ID:winifredrayen,项目名称:commondepot,代码行数:26,代码来源:IntroFragment.cs

示例13: OnCreateView

		public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			// This is the adapter we use to populate the grid.
			mAdapter = new MeatAdapter (inflater, Resource.Layout.item_meat_grid);
			// Inflate the layout with a GridView in it.
			return inflater.Inflate (Resource.Layout.fragment_fragment_transition, container, false);
		}
开发者ID:EssMarkus,项目名称:monodroid-samples,代码行数:7,代码来源:FragmentTransitionFragment.cs

示例14: OnCreateView

        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            ViewGroup rootView = (ViewGroup)inflater.Inflate(Resource.Layout.fragment_calendar_events_read, container, false);
            settingsLayout = (LinearLayout)rootView.FindViewById(Resource.Id.go_settings_layout);
            readEventsLayout = (LinearLayout)rootView.FindViewById(Resource.Id.read_events_layout);

            RadCalendarView calendarView = new RadCalendarView(Activity);

            adapter = new EventReadAdapter(calendarView);
            calendarView.EventAdapter = adapter;

            Button settingsButton = (Button)rootView.FindViewById(Resource.Id.go_settings_button);
            settingsButton.Click += (object sender, EventArgs e) => {
                GoToSettings();
            };

            Button readEventsButton = (Button)rootView.FindViewById(Resource.Id.read_events_button);
            readEventsButton.Click += (object sender, EventArgs e) => {
                TryReadEvents();
            };
            InitLayoutVisibility();
            rootView.AddView(calendarView);

            return rootView;
        }
开发者ID:harith1997,项目名称:Android-samples,代码行数:25,代码来源:ReadEventsFragment.cs

示例15: OnCreateView

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

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

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

			view.FindViewById<Button>(Resource.Id.btnAddEvent).Click += async (object sender, EventArgs e) => {
				MainActivity mainActivity = (MainActivity) this.Activity;
				List<VBTeam> listTeams = await DB_Communicator.getInstance().SelectTeams();
				mainActivity.switchFragment(ViewController.UPCOMING_EVENTS_FRAGMENT, ViewController.ADD_EVENT_FRAGMENT, new AddEventFragment(listTeams));
			};

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


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