public PullableContentView(BaseView baseview, CustomScroll customscroll, UILabel lable) : base()
 {
     baseView     = baseview;
     customScroll = customscroll;
     label        = lable;
     this.AddSubview(baseview);
     this.AddSubview(customscroll);
     this.AddSubview(lable);
 }
예제 #2
0
		void load()
		{

			scrollView = new CustomScroll(new CGRect(0, pullToRefresh.Frame.Height - 150, pullToRefresh.Frame.Width, 150));

			mainView.AddSubview(scrollView);
			scrollView.BackgroundColor = UIColor.FromRGBA(0, 0.478f, 0.667f, 1);
			scrollView.ShowsHorizontalScrollIndicator = false;
			scrollView.ShowsVerticalScrollIndicator = false;
			int x = 0;
			List<WeatherModel> array = addPopulationData();

			baseView = new BaseView(new CGRect(0, (Frame.Height / 4), Frame.Width, Frame.Height / 2));
			baseView.model = array[0];
			baseView.updateBaseView();


			for (int i = 0; i < array.Count; i++)
			{
				WeatherView button = new WeatherView(new CGRect(x, 20, 100, 100));
				button.model = array[i];
				button.baseView = baseView;
				button.drawView();
				if (i == 0)
				{
					baseView.selectedView = button;
					button.selectView();

				}
				scrollView.AddSubview(button);

				x += (int)button.Frame.Width;
			}

			scrollView.ContentSize = new CGSize(x, 0);

			mainView.AddSubview(baseView);

			UILabel label = new UILabel(new CGRect(0, 20, pullToRefresh.Frame.Width, 50));
			label.Text = @"MorrisVille";
			label.TextColor = UIColor.White;
			label.Font = UIFont.SystemFontOfSize(14);
			label.TextAlignment = UITextAlignment.Center;
			mainView.AddSubview(label);
		}