App is not recognising the entered text

Issue:
I need to enter user name ,password and click on login button.I am able to enter user name and password and click on login.The text is visible in the real device.But actually the app is not recognising the text i have entered.I am getting error message “Enter your user name”.App has no bugs.I have verified manually.

I am using appium 1.5.3,IOS 9.3.4,iPhone 5s,Selenium-java.

I have used below code:

((MobileElement) driver.findElement(By.className(“UIATextField”))).setValue(“username”);
((MobileElement) driver.findElement(By.className(“UIASecureTextField”))).setValue(“password”);
System.out.println(driver.findElement(By.className(“UIATextField”)).isDisplayed());
System.out.println(driver.findElement(By.className(“UIASecureTextField”)).isDisplayed());
System.out.println(driver.findElement(By.className(“UIAButton”)).isDisplayed());
driver.findElement(By.className(“UIAButton”)).click();

PLEAE NOTE THE CONSOLE OUTPUT:
false
false
true

I also tried sendKey method which is not working.
Can you please help?

visible attribute value for the element is false.Not sure whether it is the reason for this behaviour.