Exemplo n.º 1
0
        // Customize the appearance of table view cells.
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            posItem cell = tableView.DequeueReusableCell(cellIdentifier) as posItem;

            if (cell == null)
            {
                cell          = new posItem(cellIdentifier, controller.UserInterfaceIdiomIsPhoneNo);
                cell.isIphone = controller.UserInterfaceIdiomIsPhoneNo;
                //cell.controller = controller as UIDetail;

                //viewTbl.Layer.BorderWidth = 0.5f;
                //viewTbl.Layer.BorderColor = UIColor.FromRGB (102, 153, 173).CGColor;
                UIView viewTbl = new UIView(cell.Bounds);
                //viewTbl.Layer.BorderWidth = 0.5f;
                //viewTbl.Layer.BorderColor = UIColor.FromRGB (102, 153, 173).CGColor;
                viewTbl.BackgroundColor = UIColor.Clear;
                //viewTbl.BackgroundColor = UIColor.Yellow;
                viewTbl.Layer.MasksToBounds = true;
                //viewTbl.Layer.CornerRadius = 5;

                var oGradienttblMain = new CAGradientLayer();
                oGradienttblMain.BorderWidth = 0f;

                //oGradienttblMain.CornerRadius  = 3;
                oGradienttblMain.Frame  = new System.Drawing.RectangleF(0, 0, 1024, 92);
                oGradienttblMain.Colors = new CGColor[] {
                    //20130628

                    /*UIColor.FromRGB (255,255,255).CGColor,
                     * UIColor.FromRGB (248,248,248).CGColor,
                     * UIColor.FromRGB (238,238,238).CGColor,
                     * UIColor.FromRGB (229,229,229).CGColor,
                     * UIColor.FromRGB (220,220,220).CGColor*/
                    UIColor.FromRGB(255, 255, 255).CGColor,
                    UIColor.FromRGB(255, 255, 255).CGColor,
                    UIColor.FromRGB(255, 255, 255).CGColor,
                    UIColor.FromRGB(248, 248, 248).CGColor,
                    UIColor.FromRGB(234, 234, 234).CGColor
                };
                viewTbl.Layer.InsertSublayer(oGradienttblMain, 0);                 // .AddSublayer (oGradient);
                //cell.controller = controller as UIDetail;

                //viewTbl.Layer.BorderWidth = 0.5f;
                //viewTbl.Layer.BorderColor = UIColor.FromRGB (102, 153, 173).CGColor;
                cell.BackgroundView = viewTbl;
            }

            cell.userMember = list [indexPath.Row];
            //if (indexPath.Section == 2)
            cell.UpdateCell(list [indexPath.Row].title); //,ItemsDinings [indexPath.Section].mapFeature + " >> " + ItemsDinings [indexPath.Section].adress);

            return(cell);
        }
Exemplo n.º 2
0
        // Customize the appearance of table view cells.
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            var item = list [indexPath.Row];

            if (item.isPresentAsCategory)
            {
                posItem cell = tableView.DequeueReusableCell(cellIdentifier) as posItem;

                if (cell == null)
                {
                    cell          = new posItem(cellIdentifier, controller.UserInterfaceIdiomIsPhoneProp);
                    cell.isIphone = controller.UserInterfaceIdiomIsPhoneProp;
                    //cell.controller = controller as UIDetail;

                    //viewTbl.Layer.BorderWidth = 0.5f;
                    //viewTbl.Layer.BorderColor = UIColor.FromRGB (102, 153, 173).CGColor;
                    UIView viewTbl = new UIView(new System.Drawing.RectangleF(0, 0, 1024, 92));
                    viewTbl.AutosizesSubviews = true;
                    viewTbl.AutoresizingMask  = UIViewAutoresizing.FlexibleWidth;
                    //viewTbl.Layer.BorderWidth = 0.5f;
                    //viewTbl.Layer.BorderColor = UIColor.FromRGB (102, 153, 173).CGColor;
                    viewTbl.BackgroundColor = UIColor.Clear;
                    //viewTbl.BackgroundColor = UIColor.Yellow;
                    viewTbl.Layer.MasksToBounds = true;
                    //viewTbl.Layer.CornerRadius = 5;

                    var oGradienttblMain = new CAGradientLayer();
                    oGradienttblMain.BorderWidth = 0f;

                    //oGradienttblMain.CornerRadius  = 3;
                    oGradienttblMain.Frame  = new System.Drawing.RectangleF(0, 0, 1024, 92);
                    oGradienttblMain.Colors = new CGColor[] {
                        //20130628

                        /*UIColor.FromRGB (255,255,255).CGColor,
                         * UIColor.FromRGB (248,248,248).CGColor,
                         * UIColor.FromRGB (238,238,238).CGColor,
                         * UIColor.FromRGB (229,229,229).CGColor,
                         * UIColor.FromRGB (220,220,220).CGColor*/
                        UIColor.FromRGB(255, 255, 255).CGColor,
                        UIColor.FromRGB(255, 255, 255).CGColor,
                        UIColor.FromRGB(255, 255, 255).CGColor,
                        UIColor.FromRGB(248, 248, 248).CGColor,
                        UIColor.FromRGB(234, 234, 234).CGColor
                    };
                    viewTbl.Layer.InsertSublayer(oGradienttblMain, 0);                     // .AddSublayer (oGradient);
                    //cell.controller = controller as UIDetail;

                    //viewTbl.Layer.BorderWidth = 0.5f;
                    //viewTbl.Layer.BorderColor = UIColor.FromRGB (102, 153, 173).CGColor;
                    cell.BackgroundView = viewTbl;
                }
                iportogruaropos cat = new iportogruaropos();
                cat.icon   = item.icon_image;
                cat.poi_id = item.cat_id;
                cat.title  = item.name;



                cat.lat = item.lat;
                cat.lon = item.lon;

                cell.userMember = cat;
                //if (indexPath.Section == 2)
                cell.UpdateCell(list [indexPath.Row].name);                 //,ItemsDinings [indexPath.Section].mapFeature + " >> " + ItemsDinings [indexPath.Section].adress);

                return(cell);
            }
            else
            {
                mainItem cell = tableView.DequeueReusableCell(cellIdentifier) as mainItem;

                if (cell == null)
                {
                    cell = new mainItem(cellIdentifier, controller.UserInterfaceIdiomIsPhoneProp);

                    UIView viewTbl = new UIView(cell.Bounds);
                    //viewTbl.Layer.BorderWidth = 0.5f;
                    //viewTbl.Layer.BorderColor = UIColor.FromRGB (102, 153, 173).CGColor;
                    viewTbl.BackgroundColor     = UIColor.Clear;
                    viewTbl.BackgroundColor     = UIColor.White;
                    viewTbl.Layer.MasksToBounds = true;
                    //viewTbl.Layer.CornerRadius = 5;

                    var oGradienttblMain = new CAGradientLayer();
                    oGradienttblMain.BorderWidth = 0f;

                    //oGradienttblMain.CornerRadius  = 3;
                    oGradienttblMain.Frame  = new System.Drawing.RectangleF(0, 0, 1024, 51);
                    oGradienttblMain.Colors = new CGColor[] {
                        //20130628
                        UIColor.FromRGB(255, 255, 255).CGColor,
                        UIColor.FromRGB(248, 248, 248).CGColor,
                        UIColor.FromRGB(238, 238, 238).CGColor,
                        UIColor.FromRGB(229, 229, 229).CGColor,
                        UIColor.FromRGB(220, 220, 220).CGColor
                    };
                    viewTbl.Layer.InsertSublayer(oGradienttblMain, 0);             // .AddSublayer (oGradient);
                    viewTbl.AutosizesSubviews = true;
                    viewTbl.AutoresizingMask  = UIViewAutoresizing.FlexibleWidth;
                    cell.BackgroundView       = viewTbl;
                }

                cell.userMember = list [indexPath.Row];
                //if (indexPath.Section == 2)
                cell.UpdateCell(list [indexPath.Row].name);//,ItemsDinings [indexPath.Section].mapFeature + " >> " + ItemsDinings [indexPath.Section].adress);

                return(cell);
            }
        }