예제 #1
0
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            // Reuse a cell if one exists
            MainScreenCell cell = tableView.DequeueReusableCell("MainScreenCell") as MainScreenCell;

            if (cell == null)
            {
                // We have to allocate a cell
                cell = new MainScreenCell();
            }

            // Set initial data
            if (ctrl.Engine.GameState == EngineGameState.Playing)
            {
                cell.RefreshCell(owner, ctrl.Engine, indexPath.Row);
            }

            return(cell);
        }
예제 #2
0
        public override float GetHeightForRow(UITableView tableView, NSIndexPath indexPath)
        {
            MainScreenCell cell = new MainScreenCell();

            // Set initial data
            if (ctrl != null && ctrl.Engine != null && ctrl.Engine.GameState == EngineGameState.Playing)
            {
                cell.RefreshCell(owner, ctrl.Engine, indexPath.Row);
            }

            float height = 0;

            foreach (UIView v in cell.ContentView)
            {
                if (v.Frame.Bottom > height)
                {
                    height = v.Frame.Bottom;
                }
            }

            return(height + 10);
        }
예제 #3
0
		public override float GetHeightForRow (UITableView tableView, NSIndexPath indexPath)
		{
			MainScreenCell cell = new MainScreenCell();

			// Set initial data 
			if (ctrl != null && ctrl.Engine != null && ctrl.Engine.GameState == EngineGameState.Playing) 
			{
				cell.RefreshCell (owner, ctrl.Engine, indexPath.Row);
			}

			float height = 0;

			foreach (UIView v in cell.ContentView)
				if (v.Frame.Bottom > height)
					height = v.Frame.Bottom;

			return height + 10;
		}
예제 #4
0
		public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath)
		{ 
			// Reuse a cell if one exists 
			MainScreenCell cell = tableView.DequeueReusableCell ("MainScreenCell") as MainScreenCell;
			
			if (cell == null) 
			{  
				// We have to allocate a cell 
				cell = new MainScreenCell();
			}
			
			// Set initial data 
			if (ctrl.Engine.GameState == EngineGameState.Playing) 
			{
				cell.RefreshCell (owner, ctrl.Engine, indexPath.Row);
			}
			
			return cell; 
		}