ListView not unselecting

后端 未结 4 991
北海茫月
北海茫月 2021-01-14 23:19

I am working on a Xamarin.Forms project with a ListView.

The XAML for the ListView is



        
4条回答
  •  我在风中等你
    2021-01-14 23:59

    On Android If you only want to change the color when use clicks the ListView's Item. You can modify the style:

    Before Api 21, create a xml file in the drawable folder:

    
    
        
        
                                    
    
    

    On Api 21+, under the drawable-v21 folder create the file with same name:

    
    
      
    
    

    Then change the style in the renderer:

    // f_selector is the xml file's name
    Control.SetSelector(Resource.Drawable.f_selector);
    

    At last change the color in the resource file colors.xml:

    
    
      #3F51B5 
      #FFFFFF 
      #FF313030 
    
    

提交回复
热议问题