鼠标在背景颜色上的imagebutton

时间:2019-05-03 11:20:19

标签: xamarin.forms mouseover imagebutton

如何在鼠标悬停时更改图像按钮的颜色?

<ContentView xmlns="http://xamarin.com/schemas/2014/forms" 
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="DMInfoOrganizer.CheckBox">
    <ContentView.Content>
        <ImageButton x:Name="BtnCheck" Clicked="BtnCheck_Clicked"></ImageButton>
    </ContentView.Content>
</ContentView>

1 个答案:

答案 0 :(得分:0)

我用LucasZhang-MSFT建议的链接解决了

<Application.Resources>
       <ResourceDictionary>
           <ResourceDictionary.ThemeDictionaries>
               <ResourceDictionary x:Key="Light">
                   <SolidColorBrush x:Key="ButtonBackgroundPointerOver" Color="Transparent" />
               </ResourceDictionary>
           </ResourceDictionary.ThemeDictionaries>
       </ResourceDictionary>
   </Application.Resources> 

非常感谢