Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
648 views
in Technique[技术] by (71.8m points)

html - Apache Cordova Android 5.0 Select Box Option color

I am attempting to update an Apache Cordova Application to target Android 5.0. Everything seems to be functional so far as I can tell but I am encountering a cosmetic issue when opening a select box. The list options appear on my Nexus 7 running 5.0 with a white background and light gray text color such that the options are nearly unreadable. I have already attempted the following and more:

  • Setting the color and background-color of the options through CSS.
  • Setting -webkit-appearance:none through CSS on both the SELECT and OPTION elements.
  • Changing the theme from Theme.Black.NoTitleBar to pretty much every option available without a titlebar. The only thing this accomplished was a few that set the color of the options to white with a background color of white as well.

Sample HTML code and yes I know I'm not including cordova.js at this time.

<!DOCTYPE html>
<html>
    <head>
        <title>This is my title</title>
        <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    </head>
    <body>
        <form>
            <select name="hellow">
                <option>A</option>
                <option>B</option>
                <option>C</option>
                <option>D</option>
            </select>
            <input type="text" value="Text!"/>
            <select name="world">
                <option>A</option>
                <option>B</option>
                <option>C</option>
                <option>D</option>
            </select>
        </form>
    </body>
</html>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

After quite some time I was able to figure this out. I was apparently jsut changing the theme for the Application tag in the manifest.xml and needed to make the change in both the application and activity tags. After changing both to "android:style/Theme.Light.NoTitleBar" I now have black text on white backgrounds in my app.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...