storyboard

WPF圆角按钮与触发颜色变化

北城以北 提交于 2020-03-23 08:33:24
<Button x:Name="button1" Content="按钮1" Margin="10,10,0,0" Cursor="Pen"> <Button.Template> <ControlTemplate> <Border CornerRadius="15,15,15,15"> <Border.Background> <SolidColorBrush x:Name="color2"></SolidColorBrush> </Border.Background> <Border.Triggers> <EventTrigger RoutedEvent="Border.Loaded"> <BeginStoryboard> <Storyboard> <ColorAnimation Storyboard.TargetName="color2" Storyboard.TargetProperty="(SolidColorBrush.Color)" From="AliceBlue" To="AntiqueWhite" Duration="0:0:1" AutoReverse="True" RepeatBehavior="Forever"></ColorAnimation> </Storyboard> </BeginStoryboard> </EventTrigger> </Border

WPF圆角按钮与触发颜色变化

徘徊边缘 提交于 2020-03-23 08:32:52
原文: WPF圆角按钮与触发颜色变化 <Button x:Name="button1" Content="按钮1" Margin="10,10,0,0" Cursor="Pen"> <Button.Template> <ControlTemplate> <Border CornerRadius="15,15,15,15"> <Border.Background> <SolidColorBrush x:Name="color2"></SolidColorBrush> </Border.Background> <Border.Triggers> <EventTrigger RoutedEvent="Border.Loaded"> <BeginStoryboard> <Storyboard> <ColorAnimation Storyboard.TargetName="color2" Storyboard.TargetProperty="(SolidColorBrush.Color)" From="AliceBlue" To="AntiqueWhite" Duration="0:0:1" AutoReverse="True" RepeatBehavior="Forever"></ColorAnimation> </Storyboard> </BeginStoryboard> <

Use resource bundles in CocoaPods

我们两清 提交于 2020-03-19 19:36:36
问题 I am making a pod (MySDK) and would like to load the assets from the separate resource bundles CocoaPods generates. However, I can not get it to work. Here is how I tried to load the storyboard: let storyBoard = UIStoryboard(name: "SDK", bundle: Bundle(identifier:"org.cocoapods.SchedJoulesSDK")) This gives the error: 'Could not find a storyboard named 'SDK' in bundle The bundle is added in Xcode: And my podspec looks like this: s.resource_bundles = { 'MySDK' => ['SDK/*/*.{xib,storyboard

【WPF】实现加载中动画效果

半世苍凉 提交于 2020-03-18 16:53:13
参考自: https://blog.csdn.net/zhumingyan/article/details/50294905 后台代码: BackgroundWorker bgMeet; private void button1_Click(object sender, RoutedEventArgs e) { bgMeet = new BackgroundWorker(); //能否报告进度更新 bgMeet.WorkerReportsProgress = true; //要执行的后台任务 bgMeet.DoWork += new DoWorkEventHandler(bgMeet_DoWork); //进度报告方法 bgMeet.ProgressChanged += new ProgressChangedEventHandler(bgMeet_ProgressChanged); //后台任务执行完成时调用的方法 bgMeet.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bgMeet_RunWorkerCompleted); bgMeet.RunWorkerAsync(); //任务启动 } //执行任务 void bgMeet_DoWork(object sender, DoWorkEventArgs e)

WPF 员工卡条形码

女生的网名这么多〃 提交于 2020-03-09 05:44:21
大家都知道条形码(Barcode)是一种可以由机器识别的特殊编码,在生产、生活中也常常会见到并使用它。条形码的类型和种类很多感兴趣的朋友可以 详细了解 一下。其中Code 39 可以说是一种最为常见并广泛使用的字符与数字结合的编码类型,本篇也将利用它制作一个带有条形码的员工卡应用程序。 在公司内部员工卡是员工身份唯一的识别工具,同时也是考勤及门禁系统的主要信息来源。首先在WPF 中设计一个简单的员工卡样式,具备员工卡标识、员工相片、员工姓名等。 <Border CornerRadius="3" BorderBrush="Gray" BorderThickness="2" Background="White" MouseLeftButtonDown="Border_MouseLeftButtonDown"> <Canvas x:Name="mainCanvas"> <Grid x:Name="closeBtn" Canvas.Left="330" Canvas.Top="0" MouseLeftButtonDown="Close_MouseLeftButtonDown"> <Ellipse Height="15" Width="15" HorizontalAlignment="Center"> <Ellipse.Fill> <SolidColorBrush x:Name=

关键帧动画

别来无恙 提交于 2020-03-06 02:01:09
到目前为止,看到的所有动画都使用线性插值从起点到终点。但如果需要创建具有多个分段的动画和不规则移动的动画。例如,可能希望创建一个动画,快速地将一个元素滑入到视图中,然后慢慢地将它移到正确位置。可通过创建两个连续的动画,并使用BeginTime属性在第一个动画之后开始第二个动画来实现这种效果。然而,还有更简单的方法——可使用关键帧动画。   关键帧动画是由许多较短的段构成的动画。每段表示动画中的初始值,最终值或中间值当运行动画时,它平滑地从一个值移到另一个值。   例如,分析下面的将RadialGradientBrush画刷的中心点从一个位置移到另一个位置的Point动画: <PointAnimation Storyboard.TargetName="ellipse" Storyboard.TargetProperty="Fill.GradientOrigin" From="0.7,0.3" To="0.3,0.7" Duration="0:0:10" AutoReverse="True" RepeatBehavior="Forever"> </PointAnimation>   可使用一个效果相同的PointAnimationUsingKeyFrames对象代替这个PointAnimation对象,如下所示: 复制代码 <PointAnimationUsingKeyFrames

Is it possible to change 'is initial view controller' based upon Target?

假如想象 提交于 2020-03-05 22:23:30
问题 I have an iOS product that has a couple of different SKUs, each of which should start with a different view controller. I have the different SKUs separated by Targets, which allows me to specify the preprocessors required for that version of the product. The one thing I would like to be able to do, however, is to alter the 'is initial view controller' value in the Storyboard in order to build the different SKUs without having to manually check the box on or off depending upon what I am

Not able to set proportional height for a UIView in storyboard in Xcode 11

柔情痞子 提交于 2020-03-04 23:10:45
问题 When I am trying to set the width of a UIView to be proportional to the superview from storyboard the option is not showing up in Xcode 11. But in Xcode 10 it's showing the "Equal Widths" and "Equal Heights" option. 回答1: Works fine for me in Xcode 11.2: 来源: https://stackoverflow.com/questions/58683474/not-able-to-set-proportional-height-for-a-uiview-in-storyboard-in-xcode-11

Not able to set proportional height for a UIView in storyboard in Xcode 11

会有一股神秘感。 提交于 2020-03-04 23:07:25
问题 When I am trying to set the width of a UIView to be proportional to the superview from storyboard the option is not showing up in Xcode 11. But in Xcode 10 it's showing the "Equal Widths" and "Equal Heights" option. 回答1: Works fine for me in Xcode 11.2: 来源: https://stackoverflow.com/questions/58683474/not-able-to-set-proportional-height-for-a-uiview-in-storyboard-in-xcode-11

使用segue时如何实现login的判断

孤街醉人 提交于 2020-03-02 18:51:45
segue是storyboard中进行场景转换的核心。 实际操作的时候,和以前的代码思维方式有不同之处。比如说,login的实现。 (一) 代码思维代码: - (void)configureLoginButton { UIButton *loginButton = [UIButton ButtonWithType:UIButtonTypeCustom]; // 省略button的设置代码。 [loginButton addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside]; } - (void) buttonClicked:(id)sender { UIViewController *VC = [[UIViewController alloc] init]; [self presentViewController:VC animated:YES completion:nil]; } (二)这种代码思维如果被带到storyboard中,可能会这样操作: 在场景中设置一个 loginButton 。 选中 loginButton,Ctrl+拖拽到相应文件的代码中,生成一个IBAction方法。 在这个IBAction方法中执行上面的