public void initViews() { indexScroll = new GTHorizontalScrollView(new CGRect(0, 0, 320, 568)); Add(indexScroll); contentScroll = new GTHorizontalScrollView(new CGRect(320, 0, 320, 568)); Add(contentScroll); backButton = new UIButton(new CGRect(20 + 320, 20, 40, 40)) { BackgroundColor = UIColor.Red }; Add(backButton); backButton.TouchUpInside += (sender, e) => { UIView.Animate(0.3, 0, UIViewAnimationOptions.CurveEaseIn, () => { indexScroll.Transform = CGAffineTransform.MakeScale(1.0f, 1.0f); }, null); UIView.Animate(0.36, 0, UIViewAnimationOptions.CurveEaseIn, () => { contentScroll.Center = new PointF((float)contentScroll.Center.X + 320, (float)contentScroll.Center.Y); }, null); UIView.Animate(0.36, 0, UIViewAnimationOptions.CurveEaseIn, () => { backButton.Center = new PointF((float)backButton.Center.X + 320, (float)backButton.Center.Y); }, null); }; //init initIndex(); initContent(); }
public void initViews() { contentScroll = new GTHorizontalScrollView(new CGRect(320, 0, 320, 568)); Add(contentScroll); indexScroll = new GTHorizontalScrollView(new CGRect(0, 0, 320, 568)); Add(indexScroll); backButton = new UIButton(new CGRect(60 + 320, 20, 40, 40)); //{BackgroundColor = UIColor.Red} ; backButton.SetImage(UIImage.FromFile("MLResources/backbt.png"), UIControlState.Normal); Add(backButton); backButton.TouchUpInside += (sender, e) => { UIView.Animate(0.3, 0, UIViewAnimationOptions.CurveEaseIn, () => { indexScroll.Transform = CGAffineTransform.MakeScale(1.0f, 1.0f); }, null); UIView.Animate(0.36, 0, UIViewAnimationOptions.CurveEaseIn, () => { contentScroll.Center = new PointF((float)contentScroll.Center.X + 320, (float)contentScroll.Center.Y); }, null); UIView.Animate(0.36, 0, UIViewAnimationOptions.CurveEaseIn, () => { backButton.Center = new PointF((float)backButton.Center.X + 320, (float)backButton.Center.Y); }, null); indexScroll.Layer.ZPosition += 100; contentScroll.Layer.ZPosition -= 100; }; //init //initIndex(); initContent(); }
void initscroll() { View.BackgroundColor = UIColor.Red; //_scroll = new GTVerticalScrollView (new CGRect(0,0,320,568)); //View.Add (_scroll); hscroll = new GTHorizontalScrollView(new CGRect(0, 0, 320, 568)); View.Add(hscroll); }