0

何らかの理由でスピナーがスクロールビューの境界を通過した後、スピナーが非表示になることはありません。私は他のウィジェット(rey5137のスピナーなど)を試していて、スクロールビューで問題なく動作しているため、問題はappcompatスピナーであることが分かります。ここでScrollView内のスピナーを非表示にできません

はコードです:ここでは

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:id="@+id/activity_main" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" 
    android:paddingBottom="@dimen/activity_vertical_margin" 
    android:paddingLeft="@dimen/activity_horizontal_margin" 
    android:paddingRight="@dimen/activity_horizontal_margin" 
    android:paddingTop="@dimen/activity_vertical_margin" 
    tools:context="com.example.spinners.MainActivity"> 

    <TextView android:layout_height="wrap_content" android:layout_width="wrap_content" 
     android:textSize="30sp" 
     android:text="YOU SHALL NOT PASS !!!"/> 

    <ScrollView 
     android:layout_width="match_parent" 
     android:layout_height="300dp"> 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="vertical"> 

      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:orientation="horizontal"> 

       <TextView 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:paddingEnd="5dp" 
        android:text="NormalSpinner:"/> 
       <Spinner 
        android:layout_width="200dp" 
        android:layout_height="30dp" /> 

      </LinearLayout> 

      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:orientation="horizontal"> 

       <TextView 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:paddingEnd="5dp" 
        android:text="ReySpinner:"/> 

       <com.rey.material.widget.Spinner 
        android:layout_width="200dp" 
        android:layout_height="30dp" 
        app:spn_dividerColor="@color/colorAccent" 
        style="@style/Material.Widget.Spinner" 
        app:rd_style="@style/Material.Drawable.Ripple.Wave" 
        /> 
      </LinearLayout> 

      <!-- spamming the same spinner layout above --> 
      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:orientation="horizontal"> 

       <TextView 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:paddingEnd="5dp" 
        android:text="NormalSpinner:"/> 
       <Spinner 
        android:layout_width="200dp" 
        android:layout_height="30dp" /> 

      </LinearLayout><LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="horizontal"> 

      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:paddingEnd="5dp" 
       android:text="NormalSpinner:"/> 
      <Spinner 
       android:layout_width="200dp" 
       android:layout_height="30dp" /> 

     </LinearLayout><LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="horizontal"> 

      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:paddingEnd="5dp" 
       android:text="NormalSpinner:"/> 
      <Spinner 
       android:layout_width="200dp" 
       android:layout_height="30dp" /> 

     </LinearLayout><LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="horizontal"> 

      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:paddingEnd="5dp" 
       android:text="NormalSpinner:"/> 
      <Spinner 
       android:layout_width="200dp" 
       android:layout_height="30dp" /> 

     </LinearLayout><LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="horizontal"> 

      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:paddingEnd="5dp" 
       android:text="NormalSpinner:"/> 
      <Spinner 
       android:layout_width="200dp" 
       android:layout_height="30dp" /> 

     </LinearLayout><LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="horizontal"> 

      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:paddingEnd="5dp" 
       android:text="NormalSpinner:"/> 
      <Spinner 
       android:layout_width="200dp" 
       android:layout_height="30dp" /> 

     </LinearLayout><LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="horizontal"> 

      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:paddingEnd="5dp" 
       android:text="NormalSpinner:"/> 
      <Spinner 
       android:layout_width="200dp" 
       android:layout_height="30dp" /> 

     </LinearLayout><LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="horizontal"> 

      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:paddingEnd="5dp" 
       android:text="NormalSpinner:"/> 
      <Spinner 
       android:layout_width="200dp" 
       android:layout_height="30dp" /> 

     </LinearLayout><LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="horizontal"> 

      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:paddingEnd="5dp" 
       android:text="NormalSpinner:"/> 
      <Spinner 
       android:layout_width="200dp" 
       android:layout_height="30dp" /> 

     </LinearLayout><LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="horizontal"> 

      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:paddingEnd="5dp" 
       android:text="NormalSpinner:"/> 
      <Spinner 
       android:layout_width="200dp" 
       android:layout_height="30dp" /> 

     </LinearLayout><LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="horizontal"> 

      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:paddingEnd="5dp" 
       android:text="NormalSpinner:"/> 
      <Spinner 
       android:layout_width="200dp" 
       android:layout_height="30dp" /> 

     </LinearLayout><LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="horizontal"> 

      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:paddingEnd="5dp" 
       android:text="NormalSpinner:"/> 
      <Spinner 
       android:layout_width="200dp" 
       android:layout_height="30dp" /> 

     </LinearLayout><LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="horizontal"> 

      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:paddingEnd="5dp" 
       android:text="NormalSpinner:"/> 
      <Spinner 
       android:layout_width="200dp" 
       android:layout_height="30dp" /> 

     </LinearLayout> 

     </LinearLayout> 
    </ScrollView> 
</LinearLayout> 

は何が起こっているかの写真です: The issue

答えて

0

は(https://code.google.com/p/android/issues/detail?id=199453を参照してください)(2017年3月現在)プラットフォームの欠陥であるように思われます。バグ修正がリリースされるまで、おそらく他のスピナーソリューションの1つを使用する必要があります。

関連する問題