【问题标题】:chance text of search bar in titanium钛中搜索栏的机会文本
【发布时间】:2016-03-21 16:27:31
【问题描述】:

我正在开发一款适用于 Android 和 IOS 的钛金属应用,并且需要一个搜索栏。在IOS中它工​​作正常。背景为白色,文本为黑色,但在 android 中,文本与背景颜色相同(白色),因此不会出现。

这是我的搜索栏:

var searchBar = Titanium.UI.createSearchBar({
    barColor : '#FFFFFF',
    backgroundColor : 'transparent',
    borderRadius : 3,
    borderColor : 'black',
    height : 43,
    focusable : true,
    softKeyboardOnFocus : true,
    width : 300,
    top : deviceHeight * 0.12
})

如何更改文本颜色,使其在 android 和 IOS 中为黑色?

我没有使用合金文件夹

【问题讨论】:

    标签: android ios iphone titanium titanium-mobile


    【解决方案1】:

    Android 最好使用 SearchView 而不是 SearchBar http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Android.SearchView

    这是Appc推荐

    SearchBar 对象与 iOS 原生搜索栏非常相似。因此,并非所有功能都在其他平台上受支持。对于 Android 应用程序,请考虑改用 Titanium.UI.Android.SearchView 对象。 http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.SearchBar

    【讨论】:

      猜你喜欢
      • 2016-03-19
      • 1970-01-01
      • 2017-11-27
      • 1970-01-01
      • 1970-01-01
      • 2017-01-02
      • 1970-01-01
      • 2014-07-21
      • 1970-01-01
      相关资源
      最近更新 更多