Will having sex while treating a uti treat the uti?

I wanted to know if im taking uti meds if i have sex while taking them will the infection still clear or?