选择下拉菜单Ionic不显示文本 [英] Select dropdown Ionic don't show text

查看:1266
本文介绍了选择下拉菜单Ionic不显示文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Ionic 1.7开发应用程序。



我有一个选择菜单,我面临一个问题。



为了简化,我的代码就像文档

 < label class =item item-input item -select> 
< div class =input-label>
Lightsaber
< / div>
< select>
< option>蓝色< / option>
< option selected>绿色< / option>
< option>红色< / option>
< /选择>
< / label>



如果我打开默认浏览器,它的工作原理,框是相同的,但标签显示黑色文字,这不会发生在离子应用程序。



我试图删除所有CSS的离子,添加所有可能工作的CSS,更新Android的webview应用程序,更新平板电脑,没有什么工作。



我试图创建一个新的示例应用程序



有关如何解决此问题或强制打开本机选择菜单的任何想法或解决方法?



谢谢!

解决方案

我从这里得到正确答案:
Apache Cordova Android 5.0选择框选项颜色[RESOLVED ]



在platforms / android中找到AndroidManifest.xml并寻找此块:

 < activity android:configChanges =orientation | keyboardHidden | keyboard | screenSize | localeandroid:label =@ string / activity_nameandroid:launchMode =singleTopandroid:name =MainActivity android:theme =@ android:style / Theme.Light.NoTitleBarandroid:windowSoftInputMode =adjustResize> 
< intent-filter android:label =@ string / launcher_name>
< action android:name =android.intent.action.MAIN/>
< category android:name =android.intent.category.LAUNCHER/>
< / intent-filter>
< / activity>关键设置是:android:theme =@ android:style / Theme.Light.NoTitleBar



<



当我遇到与你相同的问题时,设置为:android:theme =@ android:style / Theme.DeviceDefault.NoActionBar Theme.Light.NoTitleBar在我的选择下拉列表中在白色给了我黑色文本。


I am developing an application in Ionic 1.7.

I have a select menu and I am facing a problem with it.

For simplification, my code is like the documentation

  <label class="item item-input item-select">
    <div class="input-label">
      Lightsaber
    </div>
    <select>
      <option>Blue</option>
      <option selected>Green</option>
      <option>Red</option>
    </select>
  </label>

http://ionicframework.com/docs/components/#select

It works well with most devices, in iOS and Android. It shows the native select menu, and everything is OK.

But I have a problem with one device, a Huawei MediaPad M2. Its my corporate tablet and this app have to work here.

The problem is, that with any code that involves select menus, the text of the options don't show. The number of the elements are correct, and I think that the labels are OK too, because if I increase the size of the labels, the box grows too.

Screenshot for reference

If I open the samples in the default browser, It works, the boxes are the same, but the labels show with black text, which don't happens in the ionic app.

I tried to remove all the CSS of ionic, add all CSS that may work, update the webview app of android, update the tablet, and nothing worked.

I tried to create a new sample app with only a select menu, and this happens too.

Any ideas, or workarounds, about how can I fix this, or force to open the native select menu?

Thanks!

解决方案

I got the correct answer from here: Apache Cordova Android 5.0 Select Box Option color [RESOLVED]

Locate AndroidManifest.xml in platforms/android and look for this block:

<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@android:style/Theme.Light.NoTitleBar" android:windowSoftInputMode="adjustResize">
            <intent-filter android:label="@string/launcher_name">
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

The key setting is: android:theme="@android:style/Theme.Light.NoTitleBar"

When I had the same problem as you, this was set to: "android:theme="@android:style/Theme.DeviceDefault.NoActionBar". Setting it to "Theme.Light.NoTitleBar" gave me black text on white in my select dropdowns.

这篇关于选择下拉菜单Ionic不显示文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆