0

アイテムを選択したときにクリック可能なリストビューがあり、アイテムを選択したときに波紋効果が働いていたが、リップル効果のためにこのラインを追加するようにスタイルファイルを変更した。リップル効果がリストビューで機能しない

<style name="InflorTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar"> 
     //other things 
     <item name="colorControlHighlight">@color/ripple_material_dark</item> 
    </style> 

この行を追加すると、リップルエフェクトはボタンで機能しますが、listviewでは機能しません。

私の問題を解決するような提案がありますか?ここ

<resources> 
    <style name="InflorTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar"> 
     <item name="windowNoTitle">true</item> 
     <item name="windowActionBar">false</item> 
     <item name="colorPrimary">@color/colorPrimary</item> 
     <item name="colorPrimaryDark">@color/colorPrimaryDark</item> 
     <item name="colorAccent">@color/colorAccent</item> 
     <item name="colorControlNormal">@color/colorAccent</item> 
     <item name="colorControlHighlight">@color/ripple_material_dark</item> 
    </style> 
    <style name="InflorTheme" parent="InflorTheme.Base"> 
    </style> 
    <style name="InflorTheme.Splash" parent="android:Theme"> 
     <item name="android:windowTranslucentStatus">true</item> 
     <item name="android:windowBackground">@drawable/splash</item> 
     <item name="android:windowNoTitle">true</item> 
    </style> 
</resources> 

が私のスタイルV-21である:ここで

<resources> 
    <style name="InflorTheme" parent="InflorTheme.Base"> 
     <item name="android:windowDrawsSystemBarBackgrounds">true</item> 
     <item name="android:windowContentTransitions">true</item> 
     <item name="android:windowAllowEnterTransitionOverlap">true</item> 
     <item name="android:windowAllowReturnTransitionOverlap">true</item> 
     <item name="android:windowSharedElementEnterTransition">@android:transition/move</item> 
     <item name="android:windowSharedElementExitTransition">@android:transition/move</item> 
    </style> 
</resources> 

は私のリストビューです:

<Mvx.MvxListView 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:id="@+id/listBoletins" 
      android:footerDividersEnabled="true" 
      android:headerDividersEnabled="true" 
      android:dividerHeight="1dp" 
      android:textFilterEnabled="false" 
      android:layout_weight="1" 
      android:background="?android:attr/selectableItemBackground" 
      local:MvxBind="ItemsSource Boletins; ItemClick BoletimClickCommand" 
      local:MvxItemTemplate="@layout/boletinsitem" /> 

答えて

0

あなたは、このようなシンプルな作りはなぜここ

は私のstlesファイルですMvxListViewの "Listview"または "appcompat listview"を使用し、あなたのrequirのためにあなたのスタイルを変更しようとするべきですements。

あなたのカスタムリストビューに独自の制限がある場合は、このようにしてください。 MYVIEWはあなたのレイアウトビュー

@Override 
protected void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.your_layout); 

    View myView = findViewById(R.id.myView); 
    int[] attrs = new int[]{R.attr.selectableItemBackground}; 
    TypedArray typedArray = getActivity().obtainStyledAttributes(attrs); 
    int backgroundResource = typedArray.getResourceId(0, 0); 
    myView.setBackgroundResource(backgroundResource); 
} 

であり、あなたは、アダプタでレンダリングされているアイテムでこれを追加あなたのxmlファイル

<android:background="?android:attr/selectableItemBackground"> 
1

にこの行を追加します。 android:foreground="?attr/selectableItemBackground" android:clickable="true" あなたの意見で

+0

どこに追加する必要がありますか? ListViewまたはレイアウトで? –

+0

ねえ、私は私の答えを更新しました。部分的な答えは申し訳ありません。 – Tasneem

+0

さんは期待した結果を得ましたthanx –

関連する問題