选择下拉式离子不显示文字 [英] Select dropdown Ionic don't show text

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

问题描述

我正在开发Ionic 1.7中的应用程序。



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



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

 < label class =item item-input item - 选择> 
< div class =input-label>
Lightsaber
< / div>
< select>
< option> Blue< / option>
<选项>绿色< / option>
< option> Red< / option>
< / select>
< / label>



如果我在默认浏览器,它工作,框是一样的,但标签显示黑色文本,这不会发生在离子应用程序。



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



我试图创建一个新的示例应用程序只有一个选择菜单,这也发生了。



有什么想法或解决方法,如何解决这个问题,或强制打开本地选择菜单? p>

谢谢!

解决方案

从这里正确答案:
Apache Cordova Android 5.0选择框选项颜色



在平台/ android中查找AndroidManifest.xml并查找此块:



android:label =@ string / activity_nameandroid:launchMode =singleTopandroid:name =MainActivityandroid: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

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.

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

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