Пример #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            nfloat w = View.Bounds.Width;
            nfloat h = View.Bounds.Height;

            View.BackgroundColor = UIColor.White;
            View.TintColor       = UIColor.Black;
            DealObject d = Config.data.GetSelectedDeal();

            UILabel lblTitle = new UILabel(new CoreGraphics.CGRect(20, 65, w - 40, 60));

            lblTitle.Lines = 2;
            lblTitle.Text  = d.Title;
            View.AddSubview(lblTitle);

            UIImageView imageView = new UIImageView();

            imageView.Image = (UIImage)d.BMP;
            imageView.Frame = new CoreGraphics.CGRect(40, 130, 128, 128);
            View.AddSubview(imageView);

            UILabel lblDescription = new UILabel(new CoreGraphics.CGRect(10, 270, w - 20, h - 270));

            lblDescription.Lines = 25;
            lblDescription.Text  = d.Description;
            View.AddSubview(lblDescription);
        }
Пример #2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            nfloat w     = View.Bounds.Width;
            nfloat h     = View.Bounds.Height;
            int    cellh = Convert.ToInt32((h - 182) / 6);

            View.BackgroundColor = UIColor.White;
            UIGraphics.BeginImageContext(this.View.Frame.Size);
            UIImage i = UIImage.FromBundle("Splash");

            i = i.Scale(this.View.Frame.Size);
            View.BackgroundColor = UIColor.FromPatternImage(i);

            for (int j = 0; j < Config.data._deals.Count; j++)
            {
                int y = 100 + j * cellh;

                DealObject d = Config.data._deals[j];

                UIButton btnDeal = UIButton.FromType(UIButtonType.Custom);
                btnDeal.Frame = new CoreGraphics.CGRect(20, y, 128, cellh);
                btnDeal.SetImage((UIImage)d.BMP, UIControlState.Normal);
                btnDeal.Tag            = j;
                btnDeal.TouchUpInside += btnDeal_TouchUpInside;
                View.AddSubview(btnDeal);


                UILabel lblTitle = new UILabel(new CoreGraphics.CGRect(150, y, w - 170, cellh));
                lblTitle.Lines = 3;
                lblTitle.Text  = d.Title;
                View.AddSubview(lblTitle);
            }
        }
Пример #3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.Deal);
            lblTitle       = FindViewById <TextView>(Resource.Id.titleDeal);
            lblDescription = FindViewById <TextView>(Resource.Id.descriptionDeal);
            imgView        = FindViewById <ImageView>(Resource.Id.imageDeal);

            DealObject d = Config.data.GetSelectedDeal();

            lblTitle.Text       = d.Title;
            lblDescription.Text = d.Description;
            imgView.SetImageBitmap((Android.Graphics.Bitmap)d.BMP);
        }
Пример #4
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            int n     = position;
            var view  = convertView ?? _activity.LayoutInflater.Inflate(Resource.Layout.DealListItem, parent, false);
            var item1 = view.FindViewById <ImageView>(Resource.Id.imageDealList);
            var item2 = view.FindViewById <TextView>(Resource.Id.titleDealList);

            if (n > -1)
            {
                DealObject z = _dat._deals[n];
                item1.SetImageBitmap((Android.Graphics.Bitmap)z.BMP);
                item2.Text = z.Title;
            }

            return(view);
        }