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


C# ListView.AddFooterView方法代码示例

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


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

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

示例2: OnCreate

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

            _viewModel = _navigationService.GetAndRemoveParameter(Intent) as CommentViewModel;
            SetContentView(Resource.Layout.Comments);

            SetSupportActionBar(FindViewById<Toolbar>(Resource.Id.CommentsToolbar));
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            Title = _viewModel.Title;

            _commentsList = FindViewById<ListView>(Resource.Id.CommentsListView);

            _replyButton = FindViewById<TextView>(Resource.Id.CommentReplyButton);
            _replyButton.SetCommand("Click", _viewModel.ReplyCommand);
            _replyButton.Enabled = false;

            _comment = FindViewById<EditText>(Resource.Id.CommentReplyText);
            _comment.Hint = _viewModel.CommentPlaceholder;

            _commentsList.Adapter = new ObservableAdapter<IListItem>()
            {
                    DataSource = _viewModel.CardViewModels,
                    GetTemplateDelegate = GetCell,
            };
            var footer = new View(this);
            footer.LayoutParameters = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)Math.Ceiling(TypedValue.ApplyDimension(ComplexUnitType.Dip, 50f, Application.Context.Resources.DisplayMetrics)));

            _commentsList.AddFooterView(footer);

            _comment.TextChanged += (sender, e) => _viewModel.Comments = _comment.Text;

            _viewModel.RequestDismissKeyboard = () =>
            {
                    InputMethodManager imm = (InputMethodManager)GetSystemService(Context.InputMethodService);
                    imm.HideSoftInputFromWindow(_comment.WindowToken, 0);

            };
            
            _viewModel.RequestCanExecute = (enabled) => _replyButton.Enabled = enabled;
            _viewModel.PropertyChanged += (sender, e) => 
                {
                    switch(e.PropertyName)
                    {
                        case "Comments":
                            if(!_comment.Text.Equals(_viewModel.Comments))
                                _comment.Text = _viewModel.Comments;
                            break;
                    }
                };
        }
开发者ID:EckyZero,项目名称:Hashtagg,代码行数:51,代码来源:CommentActivity.cs

示例3: OnCreate

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

            CommonUtils.SetFullScreen(this);
            SetContentView(Resource.Layout.Main);

            _listView = FindViewById<ListView>(Resource.Id.List);
            _listAdapter = new ListAdapter(this, new List<Tweet>());

            var footerView =
                ((LayoutInflater) GetSystemService(LayoutInflaterService)).Inflate(Resource.Layout.FooterView, null);
            _headerButton = footerView.FindViewById<Button>(Resource.Id.buttonMoreFooter);
            _headerButton.Text = "Loading";

            _listView.AddFooterView(footerView);
            _listView.Adapter = _listAdapter;

            ThreadPool.QueueUserWorkItem(lt => LoadTweets());

            FindViewById<Button>(Resource.Id.buttonFavourites).Click +=
                delegate { CommonUtils.StartNewActivity(this, typeof (FavouritesActivity)); };
        }
开发者ID:favn1585,项目名称:CiklumTweets,代码行数:23,代码来源:MainActivity.cs

示例4: OnCreate

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

            SetContentView(Resource.Layout.Places);

            _gpsTracker = ((AfaApplication)ApplicationContext).GetGpsTracker(this);
            _googlePlaces = new GooglePlacesApi.GooglePlaces(AfaConfig.GoogleApiKey);
            _loading = DialogManager.ShowLoadingDialog(this, "Retrieving Nearby Places");

            Log.Debug("Position Lat:", _gpsTracker.Latitude.ToString());
            Log.Debug("Position Lng:", _gpsTracker.Longitude.ToString());

            _placesListView = FindViewById<ListView>(Resource.Id.Places);

            var layout = new LinearLayout(this);
            _loadMoreButton = new Button(this);
            _loadMoreButton.Text = "Load More Results";
            _loadMoreButton.LayoutParameters = new TableLayout.LayoutParams(TableLayout.LayoutParams.WrapContent,
                                                                            TableLayout.LayoutParams.WrapContent, 1f);
            layout.AddView(_loadMoreButton);
            _addNewPlaceButton = new Button(this);
            _addNewPlaceButton.Text = "Add New";
            _addNewPlaceButton.LayoutParameters = new TableLayout.LayoutParams(TableLayout.LayoutParams.WrapContent,
                                                                            TableLayout.LayoutParams.WrapContent, 1f);
            layout.AddView(_addNewPlaceButton);
            _placesListView.AddFooterView(layout);

            _loadMoreButton.Click += (sender, args) => FetchMoreResults();

            _addNewPlaceButton.Click += (sender, args) =>
                                            {
                                                var intent = new Intent(this, typeof (AddPlaceActivity));
                                                StartActivity(intent);
                                            };

            DoPlacesSearch();

            var searchButton = FindViewById<ImageButton>(Resource.Id.searchButton);
            searchButton.Click += (sender, args) =>
                                      {
                                          _loading.Show();
                                          var inputManager = (InputMethodManager) GetSystemService(Context.InputMethodService);
                                          inputManager.HideSoftInputFromWindow(CurrentFocus.WindowToken, HideSoftInputFlags.NotAlways);

                                          var placeNameInput = FindViewById<EditText>(Resource.Id.placeNameSearch);
                                          var locationNameInput = FindViewById<EditText>(Resource.Id.locationSearch);

                                          var placeNameSpecified = !String.IsNullOrWhiteSpace(placeNameInput.Text);
                                          var locationNameSpecified = !String.IsNullOrWhiteSpace(locationNameInput.Text);

                                          if (!placeNameSpecified && !locationNameSpecified)
                                          {
                                              // Nothing specified, do default search
                                              DoPlacesSearch();
                                          }
                                          else if (locationNameSpecified)
                                          {
                                              _googlePlaces.Search(this, locationNameInput.Text, PlaceTypes, placeNameInput.Text, SearchCallback);
                                          }
                                          else
                                          {
                                              _googlePlaces.Search(_gpsTracker.Latitude, _gpsTracker.Longitude,
                                                                   PlaceTypes, placeNameInput.Text, SearchCallback);
                                          }
                                      };
        }
开发者ID:America4Animals,项目名称:AFA,代码行数:67,代码来源:NearbyPlacesActivity.cs

示例5: setupDrinksListView

 void setupDrinksListView(View view)
 {
     drinksListView = view.FindViewById<ListView>(Resource.Id.DrinkList);
     drinksListView.ItemClick += haveDrink;
     drinksListView.ItemLongClick += showAboutDrinkAlert;
     drinksListView.SetMinimumHeight(100);
     var inflater = Application.Context.GetSystemService(Context.LayoutInflaterService) as LayoutInflater;
     var footerLayout = inflater.Inflate(Resource.Layout.DrinksListFooter, null);
     setupNewDrinkButton(footerLayout);
     drinksListView.AddFooterView(footerLayout);
 }
开发者ID:Armoken,项目名称:Learning,代码行数:11,代码来源:TabFragments.cs

示例6: OnCreateView


//.........这里部分代码省略.........
                        }
                    }
                    catch (Exception ex)
                    {
                        Util.ShowExceptionAlert(Activity, "Add tile", ex);
                    }

                    // Refresh our tile list and count
                    await RefreshData();
                    RefreshControls();
                }
                catch (Exception e)
                {
                    Util.ShowExceptionAlert(Activity, "Add tile", e);
                }
            };
            mButtonRemoveTile = header.FindViewById<Button>(Resource.Id.buttonRemoveTile);
            mButtonRemoveTile.Click += async delegate
            {
                try
                {
                    await Model.Instance.Client.TileManager.RemoveTileTaskAsync(mSelectedTile.TileId);
                    mSelectedTile = null;
                    Toast.MakeText(Activity, "Tile removed", ToastLength.Short).Show();
                    await RefreshData();
                    RefreshControls();
                }
                catch (Exception e)
                {
                    Util.ShowExceptionAlert(Activity, "Remove tile", e);
                }
            };
            mCheckboxBadging = header.FindViewById<CheckBox>(Resource.Id.cbBadging);

            mThemeView = header.FindViewById<BandThemeView>(Resource.Id.viewCustomTheme);
            mThemeView.Theme = BandTheme.CyberTheme;
            mCheckboxCustomTheme = header.FindViewById<CheckBox>(Resource.Id.cbCustomTheme);
            mCheckboxCustomTheme.CheckedChange += (sender, e) =>
            {
                    mThemeView.Visibility = e.IsChecked ? ViewStates.Visible : ViewStates.Gone;
            };

            mEditTileName = header.FindViewById<EditText>(Resource.Id.editTileName);
            mEditTileName.TextChanged += (sender, e) => RefreshControls();

            RelativeLayout footer = (RelativeLayout)inflater.Inflate(Resource.Layout.fragment_tiles_footer, null);

            mEditTitle = footer.FindViewById<EditText>(Resource.Id.editTitle);
            mEditBody = footer.FindViewById<EditText>(Resource.Id.editBody);
            mCheckboxWithDialog = footer.FindViewById<CheckBox>(Resource.Id.cbWithDialog);

            mButtonSendMessage = footer.FindViewById<Button>(Resource.Id.buttonSendMessage);
            mButtonSendMessage.Click += async delegate
            {
                try
                {
                    await Model.Instance.Client.NotificationManager.SendMessageTaskAsync(
                        mSelectedTile.TileId,
                        mEditTitle.Text,
                        mEditBody.Text,
                        DateTime.Now,
                        mCheckboxWithDialog.Checked);
                }
                catch (Exception e)
                {
                    Util.ShowExceptionAlert(Activity, "Send message", e);
                }
            };

            mButtonSendDialog = footer.FindViewById<Button>(Resource.Id.buttonSendDialog);
            mButtonSendDialog.Click += async delegate
            {
                try
                {
                    await Model.Instance.Client.NotificationManager.ShowDialogTaskAsync(mSelectedTile.TileId, mEditTitle.Text, mEditBody.Text);
                }
                catch (Exception e)
                {
                    Util.ShowExceptionAlert(Activity, "Show dialog", e);
                }
            };

            mListTiles.AddHeaderView(header);
            mListTiles.AddFooterView(footer);

            mTileListAdapter = new TileListAdapter(this);
            mListTiles.Adapter = mTileListAdapter;

            mListTiles.ItemClick += (sender, e) =>
            {
                var position = e.Position - 1; // ignore the header
                if (position >= 0 && position < mTileListAdapter.Count)
                {
                    mSelectedTile = (BandTile) mTileListAdapter.GetItem(position);
                    RefreshControls();
                }
            };

            return rootView;
        }
开发者ID:King-of-Spades,项目名称:xamarin-samples,代码行数:101,代码来源:TilesFragment.cs

示例7: OnCreateView


//.........这里部分代码省略.........
                            Toast.MakeText(Activity, "Unable to add tile", ToastLength.Short).Show();
                        }
                    }
                    catch (Exception ex)
                    {
                        Util.ShowExceptionAlert(Activity, "Add tile", ex);
                    }

                    // Refresh our tile list and count
                    await RefreshData();
                    RefreshControls();
                }
                catch (Exception e)
                {
                    Util.ShowExceptionAlert(Activity, "Add tile", e);
                }
            };
            mButtonRemoveTile = header.FindViewById<Button>(Resource.Id.buttonRemoveTile);
            mButtonRemoveTile.Click += async delegate
            {
                try
                {
                    await Model.Instance.Client.TileManager.RemoveTileTaskAsync(mSelectedTile.TileId);
                    mSelectedTile = null;
                    Toast.MakeText(Activity, "Tile removed", ToastLength.Short).Show();
                    await RefreshData();
                    RefreshControls();
                }
                catch (Exception e)
                {
                    Util.ShowExceptionAlert(Activity, "Remove tile", e);
                }
            };
            mCheckboxBadging = header.FindViewById<CheckBox>(Resource.Id.cbBadging);

            mThemeView = header.FindViewById<BandThemeView>(Resource.Id.viewCustomTheme);
            mCheckboxCustomTheme = header.FindViewById<CheckBox>(Resource.Id.cbCustomTheme);
            mCheckboxCustomTheme.CheckedChange += (sender, e) =>
            {
                    mThemeView.Visibility = e.IsChecked ? ViewStates.Visible : ViewStates.Gone;
            };

            mEditTileName = header.FindViewById<EditText>(Resource.Id.editTileName);
            mEditTileName.TextChanged += (sender, e) => RefreshControls();

            RelativeLayout footer = (RelativeLayout)inflater.Inflate(Resource.Layout.fragment_tiles_footer, null);

            mEditTitle = footer.FindViewById<EditText>(Resource.Id.editTitle);
            mEditBody = footer.FindViewById<EditText>(Resource.Id.editBody);
            mCheckboxWithDialog = footer.FindViewById<CheckBox>(Resource.Id.cbWithDialog);

            mButtonSendMessage = footer.FindViewById<Button>(Resource.Id.buttonSendMessage);
            mButtonSendMessage.Click += async delegate
            {
                try
                {
                    await Model.Instance.Client.NotificationManager.SendMessageTaskAsync(
                        mSelectedTile.TileId,
                        mEditTitle.Text,
                        mEditBody.Text,
                        DateTime.Now,
                        mCheckboxWithDialog.Checked);
                }
                catch (Exception e)
                {
                    Util.ShowExceptionAlert(Activity, "Send message", e);
                }
            };

            mButtonSendDialog = footer.FindViewById<Button>(Resource.Id.buttonSendDialog);
            mButtonSendDialog.Click += async delegate
            {
                try
                {
                    await Model.Instance.Client.NotificationManager.ShowDialogTaskAsync(mSelectedTile.TileId, mEditTitle.Text, mEditBody.Text);
                }
                catch (Exception e)
                {
                    Util.ShowExceptionAlert(Activity, "Show dialog", e);
                }
            };

            mListTiles.AddHeaderView(header);
            mListTiles.AddFooterView(footer);

            mTileListAdapter = new TileListAdapter(this);
            mListTiles.Adapter = mTileListAdapter;

            mListTiles.ItemClick += (sender, e) =>
            {
                var position = e.Position - 1; // ignore the header
                if (position >= 0 && position < mTileListAdapter.Count)
                {
                    mSelectedTile = (BandTile) mTileListAdapter.GetItem(position);
                    RefreshControls();
                }
            };

            return rootView;
        }
开发者ID:thomashandda,项目名称:Microsoft-Band-SDK-Bindings,代码行数:101,代码来源:TilesFragment.cs


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