难忘的按钮动画或效果xamarin形式 [英] Diasble button animation or effects xamarin-forms
问题描述
我有一个触摸屏来开始页面,并且只想在点击时导航到下一页-悬停,单击/按下时没有动画/颜色变化效果.但是单击时会有一个灰色的不透明框.有人知道如何覆盖它吗?
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. 我知道还有更多方法可以执行此操作,但是我决定将整个页面创建为一个按钮,并将不透明度降低到几乎透明.
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.
推荐答案
最简单的方法是删除Button
的模板:
The easiest way to achieve this would be to remove the Button
's template:
<Button Template="{x:Null}">
... your content
</Button>
或者,您可以创建Button
样式,其模板中仅包含ContentPresenter
:
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.
这篇关于难忘的按钮动画或效果xamarin形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!