2017-10-16 62 views
0

我想挑选器添加到我的观点,虽然在屏幕上显示的选择器,当它点击它不显示选项,我选择从。Appcelerator的 - Android的选择器没有响应挖掘/点击事件

这是XML:

<Window class="container" platform="android" backgroundColor="white"> 
     <Picker id="picker" backgroundColor="black" selectionIndicator="true" useSpinner="false"> 
      <PickerColumn id="column1"> 
       <PickerRow title="Bananas"/> 
       <PickerRow title="Strawberries"/> 
       <PickerRow title="Mangos"/> 
       <PickerRow title="Grapes"/> 
      </PickerColumn> 
     </Picker> 
    </Window> 

它只是显示出与显示在第一行香蕉一个黑色的矩形。

Appcelerator info: 
Node version: 6.9.5 
Titanium SDK: 6.1.1.GA 
Target OS : Android 

谢谢

UPDATE

进一步的测试表明,这可以通过程序兼容性引起的。该应用程序本身有一个自定义的主题,我从tiapp.xml删除应用程序标签和它的孩子后,选择器正常工作。任何人遇到此问题?

我custom_theme.xml:已删除

<?xml version="1.0" encoding="utf-8"?> 
<resources> 
    <style name="Theme.SplashScreen" parent="@style/Theme.AppCompat.Fullscreen"> 
     <item name="android:windowBackground">@drawable/background</item> 
     <item name="android:windowActionBar">false</item>  
     <item name="android:windowNoTitle">true</item> 
    </style> 

    <style name="landingTheme" parent="@style/Theme.AppCompat.Translucent"> 
     <item name="android:windowBackground">@color/transparent</item> 

     <item name="colorPrimary">@color/primaryColor</item> 

     <item name="android:editTextStyle">@style/Widget.EditText</item> 
     <item name="android:drawSelectorOnTop">true</item> 
    </style> 

    <!-- <style name="Theme.TranslucentNoActionBar" parent="@style/Theme.AppCompat.Translucent"> --> 
    <style name="Theme.TranslucentNoActionBar" parent="@style/Theme.AppCompat.Translucent.NoTitleBar"> 
     <!-- Depending on the parent theme, this may be called android:windowActionBar instead of windowActionBar --> 
     <item name="android:windowIsTranslucent">true</item> 
     <item name="android:windowActionBar">false</item> 
     <item name="android:windowNoTitle">true</item> 
     <item name="android:windowBackground">@color/transparent</item> 

     <item name="colorPrimary">@color/primaryColor</item> 

     <item name="android:editTextStyle">@style/Widget.EditText</item> 
     <!--item name="android:buttonStyle">@style/Widget.App.Button</item--> 
    </style> 

    <style name="Widget.EditText" parent="Widget.AppCompat.EditText"> 
     <item name="android:padding">0dp</item> 
     <item name="android:background">@color/transparent</item> 
     <item name="android:includeFontPadding">false</item> 
    </style> 

</resources> 

应用标签:

<application android:theme="@style/landingTheme"> 
       <activity 
        android:configChanges="keyboardHidden|orientation|screenSize" 
        android:label="@string/app_name" 
        android:name=".myActivity" 
        android:theme="@style/Theme.SplashScreen" android:windowSoftInputMode="stateHidden|adjustResize"> 
        <intent-filter> 
         <action android:name="android.intent.action.MAIN"/> 
         <category android:name="android.intent.category.LAUNCHER"/> 
        </intent-filter> 
       </activity> 
       <!-- Prevent android from auto focus textfield - https://developer.appcelerator.com/question/120852/keyboard-launch-automatically-without-focus-textfield --> 
       <activity 
        android:configChanges="keyboardHidden|orientation|screenSize" 
        android:name="org.appcelerator.titanium.TiTranslucentActivity" 
        android:theme="@style/Theme.TranslucentNoActionBar" android:windowSoftInputMode="stateHidden|adjustResize"/> 
       <activity 
        android:configChanges="keyboardHidden|orientation" 
        android:name="org.appcelerator.titanium.TiActivity" 
        android:theme="@style/Theme.TranslucentNoActionBar" 
        android:screenOrientation="portrait" android:windowSoftInputMode="stateHidden|adjustResize"/> 
      </application> 

更新2:

添加信息:

Test Device: Huawei P9 
Device Android OS: 7.0 
Targetted Android version: API 23 
+0

您在使用中被tiapp.xml应用该主题的任何微调相关的属性? –

+0

不是。为了以防万一,我会发布我的'custom_theme.xml'。 – ipohfly

+0

似乎半透明的设置与此有关。 –

回答

0

的问题来自于主题之间的循环继承。您的自定义主题使用Theme.AppCompat.Translucent作为父项,但该主题本身被定义为您在tiapp.xml中提供的自定义主题的子项。这导致主题本身就是一个孩子。我怀疑你没有得到一个错误,因为landingTheme充当Theme.AppCompat.Translucent两个实例之间的一种代理。我建议你设置的landingTheme父是Theme.AppCompat和手动添加您要使用的Theme.AppCompat.Translucent属性。

0

难道是因为useSpinner属性?它自5.2.1 SDK开始已弃用。

+0

不应该...我删除了自定义主题,它的工作。 – ipohfly