Oddly enough both Maalox and Mylanta can cause constipation or diarrhea! Tums lists the same possible side effects but only in the Ultra. You may want to talk to your doctor about what would be a good option for you. All of the medications specifiy that you should talk to your OB before taking them. Did your OB give you a list of okay medications? Mine did when I was pregnant with my kids. It was nice to have a list to refer to. They may recommend a stool softener to go along with an anti-acid.
I wrote a sharepost about dealing with heartburn during pregnancy that you may find helpful.