示例#1
0
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            if (indexPath.Row % 2 == 1)
            {
                //invisible row
                UITableViewCell cell = tableView.DequeueReusableCell("blankcell");
                if (cell == null)
                {
                    cell = new UITableViewCell(UITableViewCellStyle.Default, "blankcell");
                }

                cell.BackgroundColor        = UIColor.Clear;
                cell.UserInteractionEnabled = false;

                return(cell);
            }
            else
            {
                TripTableCell cell;
                if (mTableViewCell is TripTableCellHomeScreen)
                {
                    cell = tableView.DequeueReusableCell(mCellIdentifier) as TripTableCellHomeScreen;
                    if (cell == null)
                    {
                        cell = new TripTableCellHomeScreen(mCellIdentifier);
                    }
                }
                else
                {
                    cell = tableView.DequeueReusableCell(mCellIdentifier) as TripTableCell;
                    if (cell == null)
                    {
                        cell = new TripTableCell(mCellIdentifier);
                    }
                }

                int index = indexPath.Row / 2;

                Trip trip = mTrips [index];


                string   destinationString = trip.Destination;
                string   durationString    = trip.Duration_min().ToString() + " min";
                DateTime startDate         = trip.TripStartDate;

                cell.UpdateCell(startDate.ToLocalTime(), destinationString, durationString);
                cell.Accessory = UITableViewCellAccessory.DisclosureIndicator;
                return(cell);
            }
        }
示例#2
0
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            if (indexPath.Row % 2 == 1)
            {
                //invisible row
                UITableViewCell cell = tableView.DequeueReusableCell("blankcell");
                if (cell == null)
                {
                    cell = new UITableViewCell(UITableViewCellStyle.Default, "blankcell");
                }

                cell.BackgroundColor        = UIColor.Clear;
                cell.UserInteractionEnabled = false;

                return(cell);
            }
            else
            {
                TripTableCell cell = tableView.DequeueReusableCell(mCellIdentifier) as TripTableCell;
                if (cell == null)
                {
                    cell = new TripTableCell(mCellIdentifier);
                }


                int index = indexPath.Row / 2;

                Itinerary itinerary = mSearchResult.itineraries [index];

                string durationString = itinerary.GetDuration_min().ToString() + " min";

                string stepString = itinerary.GetFirstAgencyName();

                cell.UpdateCell(itinerary.GetStartDate().ToLocalTime(), stepString, durationString);
                cell.Accessory = UITableViewCellAccessory.DisclosureIndicator;
                return(cell);
            }
        }