//This view will appear in the action bar
		public override View GetView(int position, View convertView, ViewGroup parent)
		{
			HistoryActionBarWrapper wrapper = null;
			var view = convertView;

			if(view != null)
				wrapper = view.Tag as HistoryActionBarWrapper;

			if (wrapper == null) 
			{
				view = context.LayoutInflater.Inflate(Resource.Layout.simple_spinner_item_2, null);
				wrapper = new HistoryActionBarWrapper();
				wrapper.Title = view.FindViewById<TextView>(Android.Resource.Id.Text1);
				wrapper.Subtitle = view.FindViewById<TextView>(Android.Resource.Id.Text2);
				view.Tag = wrapper;
			}


			wrapper.Title.Text = Text1;
			wrapper.Subtitle.Text = Text2;
			return view;
		}
Exemplo n.º 2
0
        //This view will appear in the action bar
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            HistoryActionBarWrapper wrapper = null;
            var view = convertView;

            if (view != null)
            {
                wrapper = view.Tag as HistoryActionBarWrapper;
            }

            if (wrapper == null)
            {
                view             = context.LayoutInflater.Inflate(Resource.Layout.simple_spinner_item_2, null);
                wrapper          = new HistoryActionBarWrapper();
                wrapper.Title    = view.FindViewById <TextView>(Android.Resource.Id.Text1);
                wrapper.Subtitle = view.FindViewById <TextView>(Android.Resource.Id.Text2);
                view.Tag         = wrapper;
            }


            wrapper.Title.Text    = Text1;
            wrapper.Subtitle.Text = Text2;
            return(view);
        }