Afonso IV of Portugal had a total of seven children: four sons and three daughters. He was married to Beatrice of Castile, and their children included notable figures such as Peter I of Portugal and Maria of Portugal, who later became queen of Castile.
For further details, you can refer to the following sources:
Here are some images related to Afonso IV of Portugal: