首先打开 Microsoft Visual Studio 2008 ,新建一个WPF项目,在上面随便放几个按钮:

然后给各个按钮设置不同的背景颜色:

设置好之后就是这样啦:

然后我们就开始在 App.xaml 文件中定义按钮样式了:

定义的样式代码如下:

以下为引用的内容: <Application x:Class="WPFButton.App"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     StartupUri="Window1.xaml">     <Application.Resources>         <!--定义按钮样式-->         <Style TargetType="Button">             <Setter Property="Foreground" Value="Black"/>             <!--修改模板属性-->             <Setter Property="Template">                 <Setter.Value>                     <!--控件模板-->                     <ControlTemplate TargetType="Button">                         <!--背景色-->                         <Border x:Name="back" Opacity="0.8" CornerRadius="3">                             <Border.BitmapEffect>                                 <OuterGlowBitmapEffect Opacity="0.7" GlowSize="0" GlowColor="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" />                             </Border.BitmapEffect>                             <Border.Background>                                 <LinearGradientBrush StartPoint="0,0" EndPoint="0,1.5">                                     <GradientBrush.GradientStops>                                         <GradientStopCollection>                                             <GradientStop Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" Offset="0"/>                                             <GradientStop Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" Offset="0.4"/>                                             <GradientStop Color="#FFF" Offset="1"/>                                         </GradientStopCollection>                                     </GradientBrush.GradientStops>                                 </LinearGradientBrush>                             </Border.Background>                             <!--前景色及边框-->                             <Border x:Name="fore" BorderThickness="1" CornerRadius="3" BorderBrush="#5555">                                 <Border.Background>                                     <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">                                         <GradientBrush.GradientStops>                                             <GradientStopCollection>                                                 <GradientStop Color="#6FFF" Offset="0.5"/>                                                 <GradientStop Color="#1111" Offset="0.51"/>                                             </GradientStopCollection>                                         </GradientBrush.GradientStops>                                     </LinearGradientBrush>                                 </Border.Background>                                 <!--按钮内容-->                                 <ContentPresenter x:Name="content" HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding  Content}">                                     <ContentPresenter.BitmapEffect>                                         <DropShadowBitmapEffect Color="#000" Direction="-90" ShadowDepth="2" Softness="0.1" Opacity="0.3" />                                     </ContentPresenter.BitmapEffect>                                 </ContentPresenter>                             </Border>                         </Border>                         <!--触发器-->                         <ControlTemplate.Triggers>                             <!--鼠标移入移出-->                             <Trigger Property="IsMouseOver" Value="True">                                 <Trigger.EnterActions>                                     <BeginStoryboard>                                         <Storyboard>                                             <DoubleAnimation To="6" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" />                                             <ColorAnimation To="#AFFF" BeginTime="0:0:0.2" Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" />                                             <ColorAnimation To="#3FFF" BeginTime="0:0:0.2" Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" />                                         </Storyboard>                                     </BeginStoryboard>                                 </Trigger.EnterActions>                                 <Trigger.ExitActions>                                     <BeginStoryboard>                                         <Storyboard>                                             <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" />                                             <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" />                                             <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" />                                         </Storyboard>                                     </BeginStoryboard>                                 </Trigger.ExitActions>                             </Trigger>                             <!--按钮按下弹起-->                             <Trigger Property="IsPressed" Value="True">                                 <Trigger.EnterActions>                                     <BeginStoryboard>                                         <Storyboard>                                             <DoubleAnimation To="3" Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" />                                             <ColorAnimation To="#3AAA" Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" />                                             <ColorAnimation To="#2111" Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" />                                         </Storyboard>                                     </BeginStoryboard>                                 </Trigger.EnterActions>                                 <Trigger.ExitActions>                                     <BeginStoryboard>                                         <Storyboard>                                             <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" />                                             <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" />                                             <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" />                                         </Storyboard>                                     </BeginStoryboard>                                 </Trigger.ExitActions>                             </Trigger>                             <!--按钮失效-->                             <Trigger Property="IsEnabled" Value="False">                                 <Setter Property="Foreground" Value="#B444"/>                                 <Trigger.EnterActions>                                     <BeginStoryboard>                                         <Storyboard>                                             <DoubleAnimation To="0" Duration="0:0:0.3" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" />                                             <DoubleAnimation To="1" Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Opacity)" />                                             <DoubleAnimation To="-135" Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Direction)" />                                             <ColorAnimation To="#FFF" Duration="0:0:0.3" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Color)" />                                             <ColorAnimation To="#D555" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" />                                             <ColorAnimation To="#CEEE" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" />                                             <ColorAnimation To="#CDDD" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" />                                         </Storyboard>                                     </BeginStoryboard>                                 </Trigger.EnterActions>                                 <Trigger.ExitActions>                                     <BeginStoryboard>                                         <Storyboard>                                             <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" />                                             <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Opacity)" />                                             <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Direction)" />                                             <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Color)" />                                             <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" />                                             <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" />                                             <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" />                                         </Storyboard>                                     </BeginStoryboard>                                 </Trigger.ExitActions>                             </Trigger>                         </ControlTemplate.Triggers>                     </ControlTemplate>                 </Setter.Value>             </Setter>         </Style>     </Application.Resources> </Application>

看了先不要头大,我们先看看最终效果,然后回过头来再解释代码:

这是常规样式

这个是鼠标移到上面时的样式

这个是鼠标点击时的样式

还有就是按钮失效时的样式

效果还算不错吧,下面来讲解代码喽,头晕的同学可以现在就收拾东西回家了哈。

我们先来看这个命名为“back”的 Border 元素,它用它的 Background 属性充当了整个按钮的背景色。

以下为引用的内容:

<Border.Background>                                 <LinearGradientBrush StartPoint="0,0" EndPoint="0,1.5">                                     <GradientBrush.GradientStops>                                         <GradientStopCollection>                                             <GradientStop Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" Offset="0"/>                                             <GradientStop Color="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" Offset="0.4"/>                                             <GradientStop Color="#FFF" Offset="1"/>                                         </GradientStopCollection>                                     </GradientBrush.GradientStops>                                 </LinearGradientBrush>                             </Border.Background>

其背景所用的是一个渐变笔刷,起始值和中间值都是引用的按钮本身的背景色,就是我们之前设置过的颜色啦,终止值是白色,这样通过位置调整,我们可以在按钮最下部产生一些向白色的过度色彩效果。

以下为引用的内容: <Border.BitmapEffect>                                 <OuterGlowBitmapEffect Opacity="0.7" GlowSize="0" GlowColor="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Button.Background).(SolidColorBrush.Color)}" />                             </Border.BitmapEffect>

它的 BitmapEffect 属性我们设置了一个大小为 0 的外发光效果,平常是看不见这效果的,在这里预先设置好,是为了在鼠标移入、按下时实现动画使用。

再来看看这个命名为“fore”的 Border 元素,它实现的是按钮的边框和高亮反光效果,我为它设置了一个半透明的黑色1像素边框,使得这个边框的色彩可以和背景色混合起来。

以下为引用的内容:  <Border.Background>                                     <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">                                         <GradientBrush.GradientStops>                                             <GradientStopCollection>                                                 <GradientStop Color="#6FFF" Offset="0.5"/>                                                 <GradientStop Color="#1111" Offset="0.51"/>                                             </GradientStopCollection>                                         </GradientBrush.GradientStops>                                     </LinearGradientBrush>                                 </Border.Background>

它的背景同样采用的渐变笔刷,起始值和终止值的位置几乎贴在一起,从而形成比较鲜明的反光度对比。

ContentPresenter 元素用于呈现按钮原本的内容,对于按钮来说就是按钮上的文字了,当然也可能会存在图片或其它东西。

以下为引用的内容:  <ContentPresenter.BitmapEffect>                                         <DropShadowBitmapEffect Color="#000" Direction="-90" ShadowDepth="2" Softness="0.1" Opacity="0.3" />                                     </ContentPresenter.BitmapEffect>

我为之加了一个不太明显的阴影滤镜以增强显示效果。

剩下的就是些可爱又该死的 Trigger ,我们通过这些触发器来改变按钮在不同状态时的外观。

以下为引用的内容:       <!--鼠标移入移出-->                             <Trigger Property="IsMouseOver" Value="True">                                 <Trigger.EnterActions>                                     <BeginStoryboard>                                         <Storyboard>                                             <DoubleAnimation To="6" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" />                                             <ColorAnimation To="#AFFF" BeginTime="0:0:0.2" Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" />                                             <ColorAnimation To="#3FFF" BeginTime="0:0:0.2" Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" />                                         </Storyboard>                                     </BeginStoryboard>                                 </Trigger.EnterActions>                                 <Trigger.ExitActions>                                     <BeginStoryboard>                                         <Storyboard>                                             <DoubleAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" />                                             <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" />                                             <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" />                                         </Storyboard>                                     </BeginStoryboard>                                 </Trigger.ExitActions>                             </Trigger>

在鼠标移入按钮时,我依次创建了改变外发光效果大小、改变上部反光区域颜色、改变下部反光区域颜色的动画,这里的要点就在于“Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)"”属性设置语句,琢磨一下你就能看出这是对属性路径的描述,只不过它们写起来和看起来都很让人生气。

以下为引用的内容:                        <!--按钮按下弹起-->                             <Trigger Property="IsPressed" Value="True">                                 <Trigger.EnterActions>                                     <BeginStoryboard>                                         <Storyboard>                                             <DoubleAnimation To="3" Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" />                                             <ColorAnimation To="#3AAA" Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" />                                             <ColorAnimation To="#2111" Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" />                                         </Storyboard>                                     </BeginStoryboard>                                 </Trigger.EnterActions>                                 <Trigger.ExitActions>                                     <BeginStoryboard>                                         <Storyboard>                                             <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" />                                             <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" />                                             <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" />                                         </Storyboard>                                     </BeginStoryboard>                                 </Trigger.ExitActions>                             </Trigger>

按下和弹起按钮时,我们做了相似的动画改变,与前面相比只是数值略微不同。

以下为引用的内容: <!--按钮失效-->                             <Trigger Property="IsEnabled" Value="False">                                 <Setter Property="Foreground" Value="#B444"/>                                 <Trigger.EnterActions>                                     <BeginStoryboard>                                         <Storyboard>                                             <DoubleAnimation To="0" Duration="0:0:0.3" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" />                                             <DoubleAnimation To="1" Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Opacity)" />                                             <DoubleAnimation To="-135" Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Direction)" />                                             <ColorAnimation To="#FFF" Duration="0:0:0.3" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Color)" />                                             <ColorAnimation To="#D555" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" />                                             <ColorAnimation To="#CEEE" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" />                                             <ColorAnimation To="#CDDD" Duration="0:0:0.3" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" />                                         </Storyboard>                                     </BeginStoryboard>                                 </Trigger.EnterActions>                                 <Trigger.ExitActions>                                     <BeginStoryboard>                                         <Storyboard>                                             <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" />                                             <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Opacity)" />                                             <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Direction)" />                                             <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="content" Storyboard.TargetProperty="(ContentPresenter.BitmapEffect).(DropShadowBitmapEffect.Color)" />                                             <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" />                                             <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" />                                             <ColorAnimation Duration="0:0:0.1" Storyboard.TargetName="fore" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" />                                         </Storyboard>                                     </BeginStoryboard>                                 </Trigger.ExitActions>                             </Trigger>

当按钮失效时,我要改变很多东西,首先将文字颜色设为灰色,然后依次创建了改变外发光效果大小、改变内容阴影效果不透明度、改变内容阴影效果角度、改变内容阴影效果颜色、改变按钮边框颜色、改变上部反光区域颜色、改变下部反光区域颜色的动画。

这里将先前对内容应用的阴影效果彻底改变,使之产生凹陷的效果。

好了,到这里就下课啦,文章有点冗长了,但应该对新手很有帮助,老鸟估计现在已经梦游仙境了吧。

WPF自定义漂亮的按钮样式的更多相关文章

  1. WPF界面设计技巧(2)—自定义漂亮的按钮样式

    原文:WPF界面设计技巧(2)-自定义漂亮的按钮样式 上次做了个很酷的不规则窗体,这次我们来弄点好看的按钮出来,此次将采用纯代码来设计按钮样式,不需要 Microsoft Expression Des ...

  2. 兼容IE8的flash上传框架&quot;uploadify&quot;自定义上传按钮样式的办法

    (uploadify版本:3.2.1 ) 因为公司业务的原因,所做的项目需要兼容IE8,因此做的上传插件无奈选择的是基于flash的uploadify. 由于是基于flash的,所以使用过程中,难以给 ...

  3. WPF自定义分页控件,样式自定义,简单易用

    WPF自定义分页控件 做了许久伸手党,终于有机会贡献一波,搜索一下WPF分页控件,还是多,但是不太通用,主要就是样式问题,这个WPF很好解决,还有一个就是分页控件嘛,只关心几个数字的变动就行了,把页码 ...

  4. wpf 自定义RadioButton控件样式

    实现的效果为: 我感觉来自定义RadioButton样式和定义button空间的样式差不多,只是类型不同而已. 接下来分析一下样式代码: <!--自定义单选按钮样式-->        & ...

  5. WPF 自定义TabControl控件样式

    一.前言 程序中经常会用到TabControl控件,默认的控件样式很普通.而且样式或功能不一定符合我们的要求.比如:我们需要TabControl的标题能够居中.或平均分布:或者我们希望TabContr ...

  6. WPF 自定义DataGrid控件样式

    内容转自https://www.cnblogs.com/xiaogangqq123/archive/2012/05/07/2487166.html 一.DataGrid基本样式(一) 小刚已经把Dat ...

  7. WPF 自定义TreeView控件样式,仿QQ联系人列表

    一.前言 TreeView控件在项目中使用比较频繁,普通的TreeView并不能满足我们的需求.因此我们需要滴对TreeView进行改造.下面的内容将介绍仿QQ联系人TreeView样式及TreeVi ...

  8. type=file的inpu美化,自定义上传按钮样式

    <div class="div1"> <div class="div2">点击上传</div> <input type ...

  9. wpf 自定义圆形按钮

    wpf 自定义圆形按钮 效果图 默认样式 获取焦点样式 点击样式 下面是实现代码: 一个是自定义控件类,一个是控件类皮肤 using System; using System.Collections. ...

随机推荐

  1. phpwind8.7升级9.0.1过程(一)本地和服务器数据同步的部署

    在使用phpwind的过程中需要将整个网站论坛的模板从phpwind8.7升级到phpwind9.0.1 需要首先在本地搭建和服务器端一样的环境然后在本地尝试性升级之后,然后在服务器端进行升级. 以下 ...

  2. org.eclipse.wst.common.project.facet.core.xml文件模板,解决eclipse编译报错。

    <?xml version="1.0" encoding="UTF-8"?> <faceted-project> <fixed f ...

  3. Tengine新增健康检查模块

    总结 2.tengine的状态监控 Tengine的状态监控有两种 这里演示一个健康检查模块功能 配置一个status的location location /status { check_status ...

  4. iOS CoCoa编程中视图控制器与视图类(转)

    分类: iPhone2012-05-28 11:19 837人阅读 评论(0) 收藏 举报 cocoa编程iosuinavigationcontrolleruiviewiphone iPhone编程规 ...

  5. 使用xmanager 远程redhat6.3

    之前装过一次,特别麻烦,装上只有远程还卡卡的,这次按照教程居然装的灰常顺利,不符合我bug体质的特性,一定要记下来啊~~~ 1.先关闭防火墙 # service iptables stop #chkc ...

  6. 【Android】Android实现截取当前屏幕图片并保存至SDCard

    功能 1. 实现截取当前屏幕的功能. 2. 把截取的图片保存到SDCard中的某个目录文件夹下面. Java代码 package com.app.test01; import java.io.File ...

  7. Collections方法的使用

    public static void main(String[] args) { // 0.给List排序 List<Integer> list = new ArrayList<In ...

  8. Service,测试

    这里介绍一些symfony的一些其他内容 1.创建并使用自定义service 首先创建service目录,在下面自定义一个类,并设置测试方法,之后在resources目录下面的services.xml ...

  9. golang语言中sync/atomic包的学习与使用

    package main; import ( "sync/atomic" "fmt" "sync" ) //atomic包提供了底层的原子级 ...

  10. 转:Git: git stash 用法小结

    一.应用场景 综合下网上的介绍和资料, git stash (git储藏)可用于以下情形: 发现有一个类是多余的,想删掉它又担心以后需要查看它的代码,想保存它但又不想增加一个脏的提交.这时就可以考虑  ...