Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    Dismiss Notice

Keyboard text white

Discussion in 'Android' started by HonorableDaniel, Mar 12, 2016.

  1. HonorableDaniel

    HonorableDaniel

    Joined:
    Feb 28, 2007
    Posts:
    2,973
    Anyone know why the android keyboard input text would be white? It makes it invisible because it's over a white background. See attachment for more details. The text should read "hello world". Any ideas?
     

    Attached Files:

    itsharshdeep and duck43 like this.
  2. GeodeLX

    GeodeLX

    Joined:
    Nov 28, 2013
    Posts:
    7
    I'm not certain, but I'd start by looking at the colors or Theme associated with that text field.
     
  3. HonorableDaniel

    HonorableDaniel

    Joined:
    Feb 28, 2007
    Posts:
    2,973
    Ok, but it's just a new InputField. I just created it and hit build & run. I didn't modify the InputField whatsoever.
     
  4. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,129
    Which version of Unity are you using? It should be fixed in 5.3.2p4.
    If it is not - could be your manifest is misconfigured.
     
  5. HonorableDaniel

    HonorableDaniel

    Joined:
    Feb 28, 2007
    Posts:
    2,973
    How about 5.3.4f1, I just installed it last night. Does it have the fix as well?
     
  6. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,129
    Yes that should work.
     
  7. metastefan

    metastefan

    Joined:
    Nov 16, 2013
    Posts:
    1
    Did it work? We have the same problem with Unity 5.3.4 (p1) :-(
    Both the entered text and the OK button/text can be totally invisible (white, same as background) on some Android phones, and light gray, looks "disabled", on other phones. On iOS, it works fine.
     
  8. HonorableDaniel

    HonorableDaniel

    Joined:
    Feb 28, 2007
    Posts:
    2,973
    I'm referencing the issue where the text typed by the user is white on white making it invisible. Not sure about the ok button.

    In regards to the white on white issue, I have fixed it. I did so by deleting the Android Manifest in Plugins/Android. I think it was the Facebook SDK that put at there and messed it up.
     
    metastefan likes this.
  9. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,129
    @_Daniel_ you may want to check the contents of the deleted manifest and merge it with Unity manifest if needed - this requires some knowledge about Android manifests though.
     
  10. HonorableDaniel

    HonorableDaniel

    Joined:
    Feb 28, 2007
    Posts:
    2,973
    What do you mean by "the Unity manifest"? Where is such document?
     
  11. r-pedra

    r-pedra

    Joined:
    Dec 4, 2015
    Posts:
    104
    @Yury Habets

    Hi, we have the same issue in 5.3.4p2

    Before we updated to this version of Unity, some devices were displaying black text on dark grey field.
    Now we have white text displayed on white field (reproduced on Nexus 7 Lollipop but not on Nexus 6P Marshmallow and Moto G KitKat).

    Changing to Unity sample manifest in PlaybackEngine folder to <style name="UnityThemeSelector" parent="android:Theme.Black.NoTitleBar.Fullscreen"> does not change anything.

    Meanwhile we have a custom manifest in Plugins/Android folder, do we need to add this theme directly in our Manifest? It could be nice to add documentation about it


    EDIT: We figured out it was that. Could be nice to tell somewhere that the theme will be f***** up by an AndroidManifest which doesn't specify a theme
     
    Last edited: Apr 19, 2016
    skullthug likes this.
  12. Gentlymad

    Gentlymad

    Joined:
    Nov 11, 2014
    Posts:
    12
    So did you fix it by adding <style name="UnityThemeSelector" parent="android:Theme.Black.NoTitleBar.Fullscreen"> to every AndroidManifest?
     
  13. r-pedra

    r-pedra

    Joined:
    Dec 4, 2015
    Posts:
    104
    Nope.
    If you go in your Plugins/Android folder, you may have an Android Manifest file.
    Open it, there you should see the <application> section at the 3rd or 4th line.
    It should look a lot like this <applicationandroid:icon="@drawable/app_icon"android:label="@String/app_name"android:debuggable="false"android:hardwareAccelerated="true">

    Just add android:theme="@StyLe/UnityThemeSelector" after android:hardwareAccelerated="true" and it will solve the problem.
     
    Last edited: Aug 10, 2016
  14. Gentlymad

    Gentlymad

    Joined:
    Nov 11, 2014
    Posts:
    12
    Many Thanks! That solved the problem. :)
     
  15. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,129
    Yeah thank you @r.pedra for posting the correct solution.

    I've written a blog post about android themes about a year ago, but many things have changed since then. At least, by using style/UnityThemeSelector, you should be able to get featured without using the Support library or any other tricks.
     
  16. Vishakh_A_V

    Vishakh_A_V

    Joined:
    Nov 26, 2015
    Posts:
    5
    I tried this but gave me an error :
    stderr[
    AndroidManifest.xml:13: error: Error: No resource found that matches the given name (at 'theme' with value '@StyLe/UnityThemeSelector').

    ]
     
  17. r-pedra

    r-pedra

    Joined:
    Dec 4, 2015
    Posts:
    104
    I think UnityThemeSelector is available on recent versions of Unity, which version do you have? Maybe @Yury Habets could help you with that, as he wrote the original blogpost.
     
  18. Vishakh_A_V

    Vishakh_A_V

    Joined:
    Nov 26, 2015
    Posts:
    5
    I am using 5.3.5f1 personal ..
     
  19. r-pedra

    r-pedra

    Joined:
    Dec 4, 2015
    Posts:
    104
    Ah... It should work...
    Can you go to Unity/PlaybackEngines/AndroidPlayer/Apk/res/values where Unity is the folder where you installed Unity.(This is Mac directory but it should be similar on Windows).
    You should have a strings.xml and a styles.xml
    Open styles.xml and tell us what is inside
     
  20. Vishakh_A_V

    Vishakh_A_V

    Joined:
    Nov 26, 2015
    Posts:
    5
    <?xml version="1.0" encoding="utf-8"?>
    <resources>
    <style name="UnityThemeSelector" parent="android:Theme.Light.NoTitleBar.Fullscreen">
    </style>
    </resources>
     
  21. Vishakh_A_V

    Vishakh_A_V

    Joined:
    Nov 26, 2015
    Posts:
    5
    I made a mistake copy pasting the line like you said and didnt notice how the spellings got accidently changed.. Read the error gain and got it working after i changed android:theme="@StyLe/UnityThemeSelector" to android:theme="@style/UnityThemeSelector"... !! Sorry for the trouble.. nd thanks for helping out.. :)
     
  22. tanveerm

    tanveerm

    Joined:
    Feb 24, 2016
    Posts:
    22
    I'm also having same problem and tried the above changes, but did not help, the entire keyboard is not visible for us, but its taking clicks on the keyboard, we can see some random text getting applied on the label. Though when we try to close the keyboard it appears for a fraction of a second and then closes. Please help
     
  23. skullthug

    skullthug

    Joined:
    Oct 16, 2011
    Posts:
    175

    Just wanted to follow up with this and mention the code should actually be
    Code (CSharp):
    1. android:theme="@style/UnityThemeSelector"
    as the casing is sensitive. Otherwise this worked fine for me after tweaking it!
     
  24. jackeysee

    jackeysee

    Joined:
    Aug 4, 2016
    Posts:
    2
    Same problem,this method solve it, Thank you.
     
  25. r-pedra

    r-pedra

    Joined:
    Dec 4, 2015
    Posts:
    104
    Sorry guys for the typo, someone is called StyLe on the forum and the @ is linking to his profile. I tried to remove the link but it always come back.
     
  26. PhongPham

    PhongPham

    Joined:
    Jan 12, 2017
    Posts:
    1
    The issues still appear in unity 5.4.4.p4, and adding android:theme="@StyLe/UnityThemeSelector" seems to not fix anything except it makes the build fail every time. Does anyone success with the fix above? How to fix it ? Many thanks.
     
  27. r-pedra

    r-pedra

    Joined:
    Dec 4, 2015
    Posts:
    104
    You just need to write style instead of StyLe. Unity forum is thinking that the @ links to a user profile
     
  28. efikalti

    efikalti

    Joined:
    Dec 6, 2016
    Posts:
    2
    Unity 5.6.0f3
    My manifest file already contained the android:theme="@StyLe/UnityThemeSelector" line and still I am getting the white letters issue.Any update on that?

    It is actually style in the file, forum keeps changing it to the username
     
  29. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,129
    That should work, unless something is very custom/broken on your device.
     
  30. efikalti

    efikalti

    Joined:
    Dec 6, 2016
    Posts:
    2
    You re right, I was changing the wrong file after all, it works fine now. Thank you!
     
  31. jotamaza

    jotamaza

    Joined:
    Apr 12, 2015
    Posts:
    8
    This has happened to me today. I'm using Unity 5.5.1f1, so I understand the fix should be applied in this version.

    I've inserted the android:theme code in the AndroidManifest.xml file and now it is working ok.
     
  32. ApexPoint

    ApexPoint

    Joined:
    Nov 28, 2014
    Posts:
    1
    Thank you guys! I've just solved the same problem
     
  33. dmpitu

    dmpitu

    Joined:
    Oct 4, 2017
    Posts:
    2
    Many Thanks!!! In my case, after import firebase_unity_sdk_4.1.0 (FirebaseMessaging) using unity 5.5.2 same error, white text in the keyword. Adding android:theme="@style/UnityThemeSelector (with lowercase, letter S and letter L) solved this.
     
  34. schoktra

    schoktra

    Joined:
    May 4, 2018
    Posts:
    1
    Here's my question... You all seem to only wanna focus on the developer... How can us poor users of some unity app which has not cared to fix this problem in development fix it on our android device (system wide if possible) so that we can see what we are doing when typing in our favorite games?
     
  35. Mr-C

    Mr-C

    Joined:
    Nov 18, 2015
    Posts:
    2
    "Adding android:theme" solves the problem, thanks pedra :)
     
  36. Savidiy

    Savidiy

    Joined:
    Oct 16, 2016
    Posts:
    6
    Thank you, it helped me too
    Code (CSharp):
    1. android:theme="@styLe/UnityThemeSelector"
     
unityunity