Unable to detect view components in webpage using Appium

Right now we are trying to click in a text field using co-ordinates for entering username and passwords as we couldn’t detect those particular textfields components.

We couln’t generalize these usecases using co-ordinates approach.

Please suggest us the generalized approach for this issue.

Thanks in advance.