Having a poor credit record can make it challenging to prove mortgage affordability, but a lot depends on what sort of credit issues you have had, and how long ago they took place.
Some lenders will disregard minor credit issues or those that happened several years ago. If you have had severe credit problems, it might be that a specialist bad credit lender is your best bet.