The infant was in the back seat of a car where his mother and a man were detained in connection with alleged drug dealing.
One of the suspects tried to attack officers making the arrests, prosecutors claimed.
Thomas Barry, 28, whose address was given as HMP Maghaberry, faces charges of possessing Class B drugs with intent to supply, assault and resisting police.
The court was told he was in a Renault Clio with his co-accused at a car park in Gilford last July.
Counsel for the prosecution claimed Barry was seen holding a plastic container later found to contain 35 deal bags of herbal cannabis.
A further quantity of cannabis resin was discovered, with the total value of the drugs estimated at between £900 - £1,800.
More than £1,600 in cash was also seized by police, some of which was located on the co-accused's young son.
"The child had £500 in his coat pocket," the prosecution barrister said.
It was claimed that Barry became aggressive, attempting to strike and punch officers as he was being restrained.
Seeking bail, his lawyer claimed no contact was made during the incident.
He said Barry has a drug addiction problem, but has gone onto a prison wing with non-users.
However, Mr Justice O'Hara refused bail after being told of another separate alleged car park incident involving a cannabis handover.
Citing the risk of re-offending, the judge said: "I can't release somebody who is caught, apparently, selling when he is on bail for apparently selling."