Diasble button animation or effects xamarin-forms

亡梦爱人 提交于 2019-12-25 04:04:08

问题


I have a touch screen to start page, and would just want to navigate to the next page when tapped - no animations/color changing effects on hover, clicked/pressed. But there's a gray opaque box when clicked... Anyone know how to override it?

P.S. I know there are more ways to do this but I decided to create the whole page as a button and reduced the opacity to almost transparent.


回答1:


The easiest way to achieve this would be to remove the Button's template:

<Button Template="{x:Null}">
    ... your content
</Button>

Alternatively you can create a Button style, with just ContentPresenter in its template:

<Style x:Key="InvisibleButtonStyle" TargetType="Button">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="Button">
                <ContentPresenter />
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

And you can reuse this style on multiple places.



来源:https://stackoverflow.com/questions/40724545/diasble-button-animation-or-effects-xamarin-forms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!