void initParallax() { _topview = new UIView(new CGRect(0, 0, _width, 2000)) { BackgroundColor = UIColor.Clear }; //var topsubview = new UIView (new CGRect (0,_topheight,_width,2000-_topheight)){BackgroundColor = UIColor.White}; //_topview.Add (topsubview); loadHeaderView(); loadDescription(); _backview = new UIView(new CGRect(0, 0, _width, _height * 2)) { BackgroundColor = UIColor.Black }; //Badr image from back Scroll _backimage = new UIImageView(new CGRect(0, 0, _width, _height)) { ContentMode = UIViewContentMode.ScaleAspectFill }; _backimage.Image = UIImage.FromFile("fullpag.png"); _backview.Add(_backimage); //Set the main view for Badr pscroll = new BadrScrollView(0, 0, _width, _height); pscroll.SetContent(_topview, 5000); pscroll.SetBackContent(_backview, 1500); Add(pscroll); }
void addView() { _topview = new UIView(new CGRect(0, 0, 1024, 2000)) { BackgroundColor = UIColor.Clear }; var topsubview = new UIView(new CGRect(0, 300, 1024, 2000 - 300)) { BackgroundColor = UIColor.Blue }; _topview.Add(topsubview); _backview = new UIView(new CGRect(0, 0, 1024, 1000)) { BackgroundColor = UIColor.Black }; //Main image from back _backimage = new UIImageView(new CGRect(0, 0, 1024, 800)) { ContentMode = UIViewContentMode.ScaleToFill }; _backimage.Image = UIImage.FromFile("myimage.jpg"); _backview.Add(_backimage); BadrScrollView pscroll = new BadrScrollView(0, 0, 1024, 768); pscroll.SetContent(_topview, 5000); pscroll.SetBackContent(_backview, 1500); View.Add(pscroll); }